summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/tests/test_fake_image_view.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_image_view.py b/vio/vio/tests/test_fake_image_view.py
index 7a49014..6b01b32 100644
--- a/vio/vio/tests/test_fake_image_view.py
+++ b/vio/vio/tests/test_fake_image_view.py
@@ -85,3 +85,21 @@ class TestFakeImageDownload(unittest.TestCase):
}
resp = self.view.get(mock.Mock(), "1234abcd")
self.assertEqual(200, resp.status_code)
+
+
+class TestFakeImageUpload(unittest.TestCase):
+
+ def setUp(self):
+ self.view = views.FakeImageUpload()
+
+ @mock.patch.object(fakeResponse, "upload_image")
+ def test_get(self, mock_upload_image):
+ mock_upload_image.return_value = {
+ "id": "1234abcd"
+ }
+ req = mock.Mock()
+ req.body = """{
+ "name": "abcd"
+ }"""
+ resp = self.view.post(req)
+ self.assertEqual(201, resp.status_code)