diff options
Diffstat (limited to 'openstackclient/tests/unit/object')
| -rw-r--r-- | openstackclient/tests/unit/object/v1/fakes.py | 2 | ||||
| -rw-r--r-- | openstackclient/tests/unit/object/v1/test_object_all.py | 22 |
2 files changed, 24 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/object/v1/fakes.py b/openstackclient/tests/unit/object/v1/fakes.py index 0ff594bc..72646d25 100644 --- a/openstackclient/tests/unit/object/v1/fakes.py +++ b/openstackclient/tests/unit/object/v1/fakes.py @@ -75,6 +75,8 @@ OBJECT_2 = { 'last_modified': object_modified_2, } +object_upload_name = 'test-object-name' + class TestObjectv1(utils.TestCommand): diff --git a/openstackclient/tests/unit/object/v1/test_object_all.py b/openstackclient/tests/unit/object/v1/test_object_all.py index a0948b1b..f215836e 100644 --- a/openstackclient/tests/unit/object/v1/test_object_all.py +++ b/openstackclient/tests/unit/object/v1/test_object_all.py @@ -13,6 +13,7 @@ import copy +from osc_lib import exceptions from requests_mock.contrib import fixture from openstackclient.object.v1 import object as object_cmds @@ -35,6 +36,27 @@ class TestObjectCreate(TestObjectAll): # Get the command object to test self.cmd = object_cmds.CreateObject(self.app, None) + def test_multiple_object_create_with_object_name(self): + arglist = [ + object_fakes.container_name, + object_fakes.object_name_1, + object_fakes.object_name_2, + '--name', object_fakes.object_upload_name, + ] + + verifylist = [ + ('container', object_fakes.container_name), + ('objects', [object_fakes.object_name_1, + object_fakes.object_name_2]), + ('name', object_fakes.object_upload_name), + ] + + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + self.assertRaises(exceptions.CommandError, + self.cmd.take_action, + parsed_args) + class TestObjectList(TestObjectAll): |
