def test_enum_in_if(converter):
class EnumType(Enum):
ENUMVALUE = 0
code = textwrap.dedent("""\
def f():
if a == EnumType.ENUMVALUE:
b""")
datamodel = DataModel(locals={'f': {'c': EnumType.ENUMVALUE}},
self_data={})
expect = textwrap.dedent("""\
procedure f is
begin
if a = ENUMVALUE then
b
end if;
end procedure;""")
conv = converter(code, datamodel)
assert expect == str(conv)
评论列表
文章目录