X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Ftests%2Ftest_admin_topics.py;h=596faebfb367ba002fea5ccc39e8afbd99641634;hp=5597979b4607c3736b18b35e7b109ce04e97398c;hb=9e87a7fbc49d98dfae5fc6b7f4c17b81729a2af7;hpb=b3d0a0e94cc4572d81477754baf56c910e892be3 diff --git a/osm_nbi/tests/test_admin_topics.py b/osm_nbi/tests/test_admin_topics.py index 5597979..596faeb 100755 --- a/osm_nbi/tests/test_admin_topics.py +++ b/osm_nbi/tests/test_admin_topics.py @@ -211,7 +211,8 @@ class Test_RoleTopicAuth(TestCase): self.fs = Mock(fsbase.FsBase()) self.msg = Mock(msgbase.MsgBase()) self.auth = Mock(authconn.Authconn(None, None, None)) - self.topic = RoleTopicAuth(self.db, self.fs, self.msg, self.auth, self.test_operations) + self.auth.role_permissions = self.test_operations + self.topic = RoleTopicAuth(self.db, self.fs, self.msg, self.auth) self.fake_session = {"username": test_name, "project_id": (test_pid,), "method": None, "admin": True, "force": False, "public": False, "allow_show_user_project_role": True} @@ -716,6 +717,7 @@ class Test_CommonVimWimSdn(TestCase): ro_pid = str(uuid4()) rw_pid = str(uuid4()) cvws = {"_id": cid, "name": self.test_name} + self.db.get_list.return_value = [] with self.subTest(i=1): cvws["_admin"] = {"projects_read": [test_pid, ro_pid, rw_pid], "projects_write": [test_pid, rw_pid]} self.db.get_one.return_value = cvws @@ -729,7 +731,7 @@ class Test_CommonVimWimSdn(TestCase): "Wrong read-only projects update") self.assertEqual(self.db.set_one.call_args[1]["update_dict"]["_admin.projects_write"], [rw_pid], "Wrong read/write projects update") - with self.subTest(i=3): + with self.subTest(i=2): now = time() cvws["_admin"] = {"projects_read": [test_pid], "projects_write": [test_pid], "operations": []} self.db.get_one.return_value = cvws