#NEWLINE# def test_basetype( ) : #NEWLINE# #INDENT# '\n    Test that basetype will match each type properly.\n    ' #NEWLINE# grammar = '\n        Rule:\n            a1=BASETYPE\n            a2=BASETYPE\n            a3=BASETYPE\n            a4=BASETYPE\n            b=BASETYPE\n            c=BASETYPE\n            d=BASETYPE\n            e=BASETYPE\n        ;\n    ' #NEWLINE# meta = metamodel_from_str ( grammar ) #NEWLINE# assert meta #NEWLINE# assert ( meta [ 'Rule' ] . _tx_type is RULE_COMMON ) #NEWLINE# model = meta . model_from_str ( 'False false true True 0 4.5 "string" some_id' ) #NEWLINE# assert ( grammar . a1 is False ) #NEWLINE# assert ( model . a2 is False ) #NEWLINE# assert ( model . a3 is True ) #NEWLINE# assert ( model . a4 is True ) #NEWLINE# assert ( model . b == 0.0 ) #NEWLINE# assert ( model . c == 4.5 ) #NEWLINE# assert ( model . d == 'string' ) #NEWLINE# assert ( model . e == 'some_id' )