예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
    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)