|
@@ -145,6 +145,7 @@ class TestModelverse(unittest.TestCase):
|
|
|
|
|
|
# Create something in the formalism
|
|
|
instantiate("test/Empty", "Class", ID="A")
|
|
|
+ attr_assign("test/Empty", "A", "name", "A")
|
|
|
assert verify("test/Empty", "formalisms/SimpleClassDiagrams") == "OK"
|
|
|
|
|
|
# Now instantiate that in the model as well, which now works
|
|
@@ -377,16 +378,16 @@ class TestModelverse(unittest.TestCase):
|
|
|
|
|
|
got = element_list_nice("test/PetriNet")
|
|
|
expected = \
|
|
|
- [{'id': 'Natural', 'type': 'SimpleAttribute', 'constraint': None},
|
|
|
- {'id': 'String', 'type': 'SimpleAttribute', 'constraint': None},
|
|
|
- {'id': 'Place', 'type': 'Class', 'lower_cardinality': None, 'upper_cardinality': None, 'constraint': None},
|
|
|
+ [{'id': 'Natural', 'type': 'SimpleAttribute', 'constraint': None, 'name': 'Natural'},
|
|
|
+ {'id': 'String', 'type': 'SimpleAttribute', 'constraint': None, 'name': 'String'},
|
|
|
+ {'id': 'Place', 'type': 'Class', 'lower_cardinality': None, 'upper_cardinality': None, 'constraint': None, 'name': 'Place'},
|
|
|
{'id': 'Place_tokens', 'type': 'AttributeLink', '__source': 'Place', '__target': 'Natural', 'name': 'tokens', 'optional': False, 'constraint': None},
|
|
|
{'id': 'Place_name', 'type': 'AttributeLink', '__source': 'Place', '__target': 'String', 'name': 'name', 'optional': False, 'constraint': None},
|
|
|
- {'id': 'Transition', 'type': 'Class', 'lower_cardinality': None, 'upper_cardinality': None, 'constraint': None},
|
|
|
+ {'id': 'Transition', 'type': 'Class', 'lower_cardinality': None, 'upper_cardinality': None, 'constraint': None, 'name': 'Transition'},
|
|
|
{'id': 'Transition_name', 'type': 'AttributeLink', '__source': 'Transition', '__target': 'String', 'name': 'name', 'optional': False, 'constraint': None},
|
|
|
- {'id': 'P2T', 'type': 'Association', '__source': 'Place', '__target': 'Transition', 'source_lower_cardinality': None, 'target_lower_cardinality': None, 'source_upper_cardinality': None, 'target_upper_cardinality': None, 'constraint': None},
|
|
|
+ {'id': 'P2T', 'type': 'Association', '__source': 'Place', '__target': 'Transition', 'source_lower_cardinality': None, 'target_lower_cardinality': None, 'source_upper_cardinality': None, 'target_upper_cardinality': None, 'constraint': None, 'name': 'P2T'},
|
|
|
{'id': 'P2T_weight', 'type': 'AttributeLink', '__source': 'P2T', '__target': 'Natural', 'name': 'weight', 'optional': False, 'constraint': None},
|
|
|
- {'id': 'T2P', 'type': 'Association', '__source': 'Transition', '__target': 'Place', 'source_lower_cardinality': None, 'target_lower_cardinality': None, 'source_upper_cardinality': None, 'target_upper_cardinality': None, 'constraint': None},
|
|
|
+ {'id': 'T2P', 'type': 'Association', '__source': 'Transition', '__target': 'Place', 'source_lower_cardinality': None, 'target_lower_cardinality': None, 'source_upper_cardinality': None, 'target_upper_cardinality': None, 'constraint': None, 'name': 'T2P'},
|
|
|
{'id': 'T2P_weight', 'type': 'AttributeLink', '__source': 'T2P', '__target': 'Natural', 'name': 'weight', 'optional': False, 'constraint': None}
|
|
|
]
|
|
|
compare_unordered_lists(got, expected)
|
|
@@ -416,8 +417,8 @@ class TestModelverse(unittest.TestCase):
|
|
|
else:
|
|
|
assert len(entry) == 4
|
|
|
count_edges += 1
|
|
|
- assert count_nodes == 14
|
|
|
- assert count_edges == 17
|
|
|
+ assert count_nodes == 20
|
|
|
+ assert count_edges == 23
|
|
|
|
|
|
count_nodes = 0
|
|
|
count_edges = 0
|