def test_01_create_content_unit(self): """Create content unit.""" attrs = gen_ansible_content_attrs(self.artifact) self.content_unit.update(self.client.post(ANSIBLE_ROLE_CONTENT_PATH, attrs)) for key, val in attrs.items(): with self.subTest(key=key): self.assertEqual(self.content_unit[key], val)
def test_03_fully_update(self): """Attempt to update a content unit using HTTP PUT. This HTTP method is not supported and a HTTP exception is expected. """ attrs = gen_ansible_content_attrs(self.artifact) with self.assertRaises(HTTPError) as exc: self.client.put(self.content_unit['_href'], attrs) self.assertEqual(exc.exception.response.status_code, 405)