diff options
author | Bin Sun <bins@vmware.com> | 2018-04-08 15:18:21 +0800 |
---|---|---|
committer | Bin Sun <bins@vmware.com> | 2018-04-08 15:18:41 +0800 |
commit | 5ce3ba7e98fbe293f9c9e4f5777bbd338d83a03c (patch) | |
tree | 5b2906ce463ce7a026b199f6629ae0f790962718 /vio | |
parent | 3b0860d00b114ef5b55a6b2b9aa6124d2e543625 (diff) |
Add image upload test
Change-Id: I4aa5b158426c422b0ba16b3ab79ebceae04b6b7e
Issue-ID: MULTICLOUD-199
Signed-off-by: Bin Sun <bins@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r-- | vio/vio/tests/test_fake_image_view.py | 18 |
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) |