diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-12-03 13:34:23 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-12-03 13:34:23 +0000 |
| commit | e1fa2c447848ea1f73efa5772aecd1d6680bfa49 (patch) | |
| tree | 5f5418f87b1e929954366450e29eb5af62f9c30d /glanceclient | |
| parent | 618dde4c8ec32ab00316e55e52a595e5e10bc331 (diff) | |
| parent | d6b0a5726e17929b95dd950c1aee7b416c6a6a6e (diff) | |
| download | python-glanceclient-e1fa2c447848ea1f73efa5772aecd1d6680bfa49.tar.gz | |
Merge "Fix tests for image-create"
Diffstat (limited to 'glanceclient')
| -rw-r--r-- | glanceclient/tests/unit/v2/test_shell_v2.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/glanceclient/tests/unit/v2/test_shell_v2.py b/glanceclient/tests/unit/v2/test_shell_v2.py index 4ccef27..cdd0ba2 100644 --- a/glanceclient/tests/unit/v2/test_shell_v2.py +++ b/glanceclient/tests/unit/v2/test_shell_v2.py @@ -122,23 +122,19 @@ class ShellV2Test(testtools.TestCase): @mock.patch('sys.stderr') def test_image_create_missing_disk_format(self, __): - # We test for all possible sources - for origin in ('--file', '--location', '--copy-from'): - e = self.assertRaises(exc.CommandError, self._run_command, - '--os-image-api-version 2 image-create ' + - origin + ' fake_src --container-format bare') - self.assertEqual('error: Must provide --disk-format when using ' - + origin + '.', e.message) + e = self.assertRaises(exc.CommandError, self._run_command, + '--os-image-api-version 2 image-create ' + + '--file fake_src --container-format bare') + self.assertEqual('error: Must provide --disk-format when using ' + '--file.', e.message) @mock.patch('sys.stderr') def test_image_create_missing_container_format(self, __): - # We test for all possible sources - for origin in ('--file', '--location', '--copy-from'): - e = self.assertRaises(exc.CommandError, self._run_command, - '--os-image-api-version 2 image-create ' + - origin + ' fake_src --disk-format qcow2') - self.assertEqual('error: Must provide --container-format when ' - 'using ' + origin + '.', e.message) + e = self.assertRaises(exc.CommandError, self._run_command, + '--os-image-api-version 2 image-create ' + + '--file fake_src --disk-format qcow2') + self.assertEqual('error: Must provide --container-format when ' + 'using --file.', e.message) @mock.patch('sys.stderr') def test_image_create_missing_container_format_stdin_data(self, __): |
