|
@@ -1563,6 +1563,66 @@ class TestModelverse(unittest.TestCase):
|
|
|
except UnknownLocation:
|
|
|
pass
|
|
|
|
|
|
+ # No permissions on locations directly, so there are no checks that have to be done
|
|
|
+
|
|
|
+ def test_op_read_outgoing(self):
|
|
|
+ model_add("users/user/test/a", "formalisms/SimpleClassDiagrams", """
|
|
|
+ SimpleAttribute String {}
|
|
|
+ Class A {
|
|
|
+ name : String
|
|
|
+ }
|
|
|
+ Class B {}
|
|
|
+ Association C (A, B) {}
|
|
|
+ Association D (C, B) {}
|
|
|
+ """)
|
|
|
+
|
|
|
+ # Test normal operation
|
|
|
+ assert read_outgoing("users/user/test/a", "A", "Association") == set(["C"])
|
|
|
+ assert read_outgoing("users/user/test/a", "A", "AttributeLink") == set(["A_name"])
|
|
|
+
|
|
|
+ # Test wildcard
|
|
|
+ assert read_outgoing("users/user/test/a", "A", "") == set(["A_name", "C"])
|
|
|
+
|
|
|
+ # Test association on association
|
|
|
+ assert read_outgoing("users/user/test/a", "C", "") == set(["D"])
|
|
|
+
|
|
|
+ # Test empty result
|
|
|
+ assert read_outgoing("users/user/test/a", "B", "") == set([])
|
|
|
+
|
|
|
+ # Test simpleattribute
|
|
|
+ assert read_outgoing("users/user/test/a", "String", "") == set([])
|
|
|
+
|
|
|
+ # Non-existing model
|
|
|
+ try:
|
|
|
+ read_outgoing("users/afa", "Association", "")
|
|
|
+ self.fail()
|
|
|
+ except UnknownModel:
|
|
|
+ pass
|
|
|
+
|
|
|
+ # Non-existing element
|
|
|
+ before = element_list("users/user/test/a")
|
|
|
+ try:
|
|
|
+ read_outgoing("users/user/test/a", "AAAAAAA", "")
|
|
|
+ self.fail()
|
|
|
+ except UnknownElement:
|
|
|
+ assert element_list("users/user/test/a") == before
|
|
|
+
|
|
|
+ # Non-existing type
|
|
|
+ before = element_list("users/user/test/a")
|
|
|
+ try:
|
|
|
+ read_outgoing("users/user/test/a", "A", "AAAAAAA")
|
|
|
+ self.fail()
|
|
|
+ except UnknownElement:
|
|
|
+ assert element_list("users/user/test/a") == before
|
|
|
+
|
|
|
+
|
|
|
+ # No read permissions
|
|
|
+ try:
|
|
|
+ read_outgoing("administration/core", "formalisms", "")
|
|
|
+ self.fail()
|
|
|
+ except ReadPermissionDenied:
|
|
|
+ pass
|
|
|
+
|
|
|
"""
|
|
|
def test_op_model_render(self):
|
|
|
def test_op_transformation_between(self):
|
|
@@ -1585,7 +1645,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_read_outgoing(self):
|
|
|
def test_op_read_incoming(self):
|
|
|
def test_op_read_association_source(self):
|
|
|
def test_op_read_association_destination(self):
|