Fix tests for image-create

image-create unit tests still checks for obsolete v1 params --location
and --copy-from

remove checking of these params

Closes-bug: 1521044

Change-Id: I75ae1a200ab319b7fb818b4ccfe784af5ef8ff88
This commit is contained in:
Jake Yip
2015-11-30 14:35:43 +11:00
parent c4cb6a42ef
commit d6b0a5726e

View File

@@ -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, __):