rollback.append({"topic": "nsrs", "_id": nsr_descriptor["id"]})
def _add_vnfr_to_db(self, vnfr_descriptor, rollback, session):
- self.format_on_new(
+ BaseTopic.format_on_new(
vnfr_descriptor, session["project_id"], make_public=session["public"]
)
self.db.create("vnfrs", vnfr_descriptor)
- _admin:
created: 1566823354.3668208
modified: 1566823354.3668208
- nsState: NOT_INSTANTIATED
projects_read:
- 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
projects_write:
- _admin:
created: 1566823354.3703845
modified: 1566823354.3703845
- nsState: NOT_INSTANTIATED
projects_read:
- 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
projects_write:
)
else:
nsr_id = created_item["nsr-id-ref"]
+ self.assertTrue(
+ "nsState" not in created_item["_admin"],
+ "Database VNF record must not contain '_admin.nsState'",
+ )
elif _call[0][0] == "nsrs":
created_nsrs.append(created_item)
)
else:
nsr_id = created_item["_id"]
+
+ self.assertTrue(
+ created_item["_admin"]["nsState"] == "NOT_INSTANTIATED",
+ "Database record must contain '_admin.nsState=NOT INSTANTIATE'",
+ )
else:
assert True, "created an unknown record {} at database".format(
_call[0][0]
created_item["_admin"],
"Database record must contain '_admin.created'",
)
- self.assertTrue(
- created_item["_admin"]["nsState"] == "NOT_INSTANTIATED",
- "Database record must contain '_admin.nstate=NOT INSTANTIATE'",
- )
self.assertEqual(
len(created_vnfrs), 2, "created a mismatch number of vnfr at database"
self.assertEqual(
vnfr_id, vnfr["id"], "Mismatch between return id and database id"
)
- self.assertEqual(
- "NOT_INSTANTIATED",
- vnfr["_admin"]["nsState"],
- "Database record must contain 'nsState' NOT_INSTANTIATED",
+ self.assertTrue(
+ "nsState" not in vnfr["_admin"],
+ "Database VNF record must not contain 'nsState'",
)
self.assertEqual(
self.vnfd_id,