<s> from textx . metamodel import metamodel_from_str <EOL> grammar = """<STR_LIT>""" <EOL> def test_auto_init ( ) : <EOL> """<STR_LIT>""" <EOL> mm = metamodel_from_str ( grammar ) <EOL> model = mm . model_from_str ( '<STR_LIT>' ) <EOL> assert model . seconds == [ ] <EOL> assert model . a == <NUM_LIT:0> <EOL> assert model . f == <NUM_LIT:0> <EOL> assert model . b is False <EOL> assert model . d is False <EOL> assert model . c == "<STR_LIT>" <EOL> def test_no_auto_init ( ) : <EOL> """<STR_LIT>""" <EOL> mm = metamodel_from_str ( grammar , auto_init_attributes = False ) <EOL> model = mm . model_from_str ( '<STR_LIT>' ) <EOL> assert model . seconds == [ ] <EOL> assert model . a is None <EOL> assert model . b is None <EOL> assert model . c is None <EOL> assert model . f is None <EOL> assert model . d is False </s>
