X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Ftests%2Ftest_admin_topics.py;h=2c8154e7cb199f2d38acaf0f7b3663531a9dad47;hp=dce871058e9dc65ec01e1c506f083d0933edf5d0;hb=7cbd03c5c21202fff473ae943e75dd49a18f2516;hpb=d7749588e6cc73661d052fc5bb41605e1b588128 diff --git a/osm_nbi/tests/test_admin_topics.py b/osm_nbi/tests/test_admin_topics.py index dce8710..2c8154e 100755 --- a/osm_nbi/tests/test_admin_topics.py +++ b/osm_nbi/tests/test_admin_topics.py @@ -481,6 +481,7 @@ class Test_UserTopicAuth(TestCase): new_name = "other-user-name" new_prms = [{}] self.auth.get_role_list.side_effect = [[user], []] + self.auth.get_user_list.side_effect = [[user]] with self.assertRaises(EngineException, msg="Accepted wrong project-role mappings") as e: self.topic.edit(self.fake_session, uid, {"username": new_name, "project_role_mappings": new_prms}) self.assertEqual(e.exception.http_code, HTTPStatus.UNPROCESSABLE_ENTITY, "Wrong HTTP status code") @@ -698,6 +699,7 @@ class Test_CommonVimWimSdn(TestCase): self.assertEqual(operation["detailed-status"], "", "Wrong operation detailed status info") self.assertIsNone(operation["operationParams"], "Wrong operation parameters") with self.subTest(i=2): + self.db.get_one.side_effect = [cvws] with self.assertRaises(EngineException, msg="Accepted wrong property") as e: self.topic.edit(self.fake_session, str(uuid4()), {"name": "new-name", "extra_prop": "anything"}) self.assertEqual(e.exception.http_code, HTTPStatus.UNPROCESSABLE_ENTITY, "Wrong HTTP status code") @@ -734,8 +736,8 @@ class Test_CommonVimWimSdn(TestCase): self.assertEqual(self.db.set_one.call_args[0][1]["_id"], cid, "Wrong CIM identifier") self.assertEqual(self.db.set_one.call_args[1]["update_dict"], None, "Wrong read-only projects update") - self.assertEqual(self.db.set_one.call_args[1]["pull"], {"_admin.projects_read." + test_pid: None, - "_admin.projects_write." + test_pid: None}, + self.assertEqual(self.db.set_one.call_args[1]["pull_list"], + {"_admin.projects_read": (test_pid,), "_admin.projects_write": (test_pid,)}, "Wrong read/write projects update") self.topic._send_msg.assert_not_called() with self.subTest(i=2):