|
@@ -1531,6 +1531,34 @@ class TestModelverse(unittest.TestCase):
|
|
|
except UnknownElement:
|
|
|
assert element_list_nice("users/user/test/d") == [{"__type" : "Class", "__id": "A", "lower_cardinality": None, "upper_cardinality": None, "constraint": {"AL": ""}, "name": None, "abstract": None}]
|
|
|
|
|
|
+ def test_op_AL_text(self):
|
|
|
+ # Test normal situation with code provided by assignment
|
|
|
+ model_add("users/user/test/b", "formalisms/SimpleClassDiagrams", """
|
|
|
+ Class A {}
|
|
|
+ """)
|
|
|
+ attr_assign_code("users/user/test/b", "A", "constraint", """
|
|
|
+ String function main(value : Element):
|
|
|
+ return "OK"!
|
|
|
+ """)
|
|
|
+ assert AL_text(read_attrs("users/user/test/b", "A")["constraint"]["AL"]).strip() == """
|
|
|
+ String function main(value : Element):
|
|
|
+ return "OK"!
|
|
|
+ """.strip()
|
|
|
+
|
|
|
+ # Test normal situation with code provided by HUTN parser (model)
|
|
|
+ model_add("users/user/test/a", "formalisms/SimpleClassDiagrams", """
|
|
|
+ Class A {
|
|
|
+ constraint = $
|
|
|
+ String function main(value : Element):
|
|
|
+ return "OK"!
|
|
|
+ $
|
|
|
+ }
|
|
|
+ """)
|
|
|
+ assert AL_text(read_attrs("users/user/test/a", "A")["constraint"]["AL"]).strip() == """
|
|
|
+ String function main(value : Element):
|
|
|
+ return "OK"!
|
|
|
+ """.strip()
|
|
|
+
|
|
|
"""
|
|
|
def test_op_model_render(self):
|
|
|
def test_op_transformation_between(self):
|
|
@@ -1553,7 +1581,6 @@ class TestModelverse(unittest.TestCase):
|
|
|
def test_op_group_list(self):
|
|
|
def test_op_conformance_delete(self):
|
|
|
def test_op_conformance_add(self):
|
|
|
- def test_op_AL_text(self):
|
|
|
def test_op_read_outgoing(self):
|
|
|
def test_op_read_incoming(self):
|
|
|
def test_op_read_association_source(self):
|