- with self.assertRaises(EngineException,
- msg="Accepted non-existent Scaling Group VDU ID Reference") as e:
- self.topic.upload_content(fake_session, did, test_vnfd, {}, {"Content-Type": []})
- self.assertEqual(e.exception.http_code, HTTPStatus.UNPROCESSABLE_ENTITY, "Wrong HTTP status code")
- self.assertIn(norm("df[id='{}']:scaling-aspect[id='{}']:scaling-config-action:vnf-"
- "config-primitive-name-ref='{}' does not match any "
- "day1-2 configuration:config-primitive:name"
- .format(df["id"], df['scaling-aspect'][0]["id"],
- sa['scaling-config-action'][0]['vnf-config-primitive-name-ref'])),
- norm(str(e.exception)), "Wrong exception text")
+ with self.assertRaises(
+ EngineException,
+ msg="Accepted non-existent Scaling Group VDU ID Reference",
+ ) as e:
+ self.topic.upload_content(
+ fake_session, did, test_vnfd, {}, {"Content-Type": []}
+ )
+ self.assertEqual(
+ e.exception.http_code,
+ HTTPStatus.UNPROCESSABLE_ENTITY,
+ "Wrong HTTP status code",
+ )
+ self.assertIn(
+ norm(
+ "df[id='{}']:scaling-aspect[id='{}']:scaling-config-action:vnf-"
+ "config-primitive-name-ref='{}' does not match any "
+ "day1-2 configuration:config-primitive:name".format(
+ df["id"],
+ df["scaling-aspect"][0]["id"],
+ sa["scaling-config-action"][0][
+ "vnf-config-primitive-name-ref"
+ ],
+ )
+ ),
+ norm(str(e.exception)),
+ "Wrong exception text",
+ )