Ejemplo n.º 1
0
 def test_01_create_content_unit(self):
     """
     Create content unit.
     """
     attrs = gen_python_package_attrs(self.artifact)
     self.content_unit.update(self.client.post(PYTHON_CONTENT_PATH, attrs))
     for key, val in attrs.items():
         with self.subTest(key=key):
             self.assertEqual(self.content_unit[key], val)
Ejemplo n.º 2
0
 def test_01_create_content_unit(self):
     """
     Create content unit.
     """
     attrs = gen_python_package_attrs(self.artifact)
     self.content_unit.update(self.client.post(PYTHON_CONTENT_PATH, attrs))
     for key, val in attrs.items():
         with self.subTest(key=key):
             self.assertEqual(self.content_unit[key], val)
Ejemplo n.º 3
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_python_package_attrs(self.artifact)
        with self.assertRaises(HTTPError):
            self.client.patch(self.content_unit['_href'], attrs)
Ejemplo n.º 4
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_python_package_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)
Ejemplo n.º 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_python_package_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)