Browse Source

Check corner case tests for conformance_add

Yentl Van Tendeloo 7 years ago
parent
commit
c6376ec1de
1 changed files with 16 additions and 1 deletions
  1. 16 1
      unit/test_all.py

+ 16 - 1
unit/test_all.py

@@ -3050,7 +3050,6 @@ class TestModelverse(unittest.TestCase):
         # Check if we can add a second one to the same MM
         conformance_add("users/user/test/a", "formalisms/Bottom")
         ts = model_types("users/user/test/a")
-        print("Got types: " + str(ts))
         assert len(ts) == 3
         assert ("formalisms/Bottom", None, None) in ts
         found = False
@@ -3066,6 +3065,22 @@ class TestModelverse(unittest.TestCase):
             assert t[2] == None
         assert found
 
+        # Check add of non-existing model
+        try:
+            conformance_add("users/user/test/b", "formalisms/Bottom")
+            self.fail()
+        except UnknownModel:
+            pass
+
+        # Check add of non-existing metamodel
+        model_add("users/user/test/b", "formalisms/SimpleClassDiagrams")
+        before = model_types("users/user/test/b")
+        try:
+            conformance_add("users/user/test/b", "formalisms/Bottom2")
+            self.fail()
+        except UnknownModel:
+            assert model_types("users/user/test/b") == before
+
     """
     def test_op_model_render(self):
     def test_op_transformation_between(self):