def test_01_create_content_unit(self): """Create content unit.""" attrs = gen_docker_image_attrs(self.artifact) self.content_unit.update(self.client.post(DOCKER_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_docker_image_attrs(self.artifact) with self.assertRaises(HTTPError): self.client.put(self.content_unit['_href'], attrs)
def test_03_partially_update(self): """Attempt to update a content unit using HTTP PATCH. This HTTP method is not supported and a HTTP exception is expected. """ attrs = gen_docker_image_attrs(self.artifact) with self.assertRaises(HTTPError) as exc: self.client.patch(self.content_unit['_href'], attrs) self.assertEqual(exc.exception.response.status_code, 405)
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_docker_image_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)