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