del test_vnfd["vdu"][0]["cloud-init-file"]
with self.assertRaises(EngineException, msg="Accepted non-existent charm in VNF configuration") as e:
self.topic.upload_content(fake_session, did, test_vnfd, {}, {"Content-Type": []})
self.assertEqual(e.exception.http_code, HTTPStatus.BAD_REQUEST, "Wrong HTTP status code")
self.assertIn(norm("{} defined in vnf[id={}] but not present in package".format("charm", test_vnfd["id"])),
norm(str(e.exception)), "Wrong exception text")
del test_vnfd["vdu"][0]["cloud-init-file"]
with self.assertRaises(EngineException, msg="Accepted non-existent charm in VNF configuration") as e:
self.topic.upload_content(fake_session, did, test_vnfd, {}, {"Content-Type": []})
self.assertEqual(e.exception.http_code, HTTPStatus.BAD_REQUEST, "Wrong HTTP status code")
self.assertIn(norm("{} defined in vnf[id={}] but not present in package".format("charm", test_vnfd["id"])),
norm(str(e.exception)), "Wrong exception text")