summaryrefslogtreecommitdiff
path: root/ceilometerclient/tests/v2/test_shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'ceilometerclient/tests/v2/test_shell.py')
-rw-r--r--ceilometerclient/tests/v2/test_shell.py36
1 files changed, 22 insertions, 14 deletions
diff --git a/ceilometerclient/tests/v2/test_shell.py b/ceilometerclient/tests/v2/test_shell.py
index 921bded..1d42c51 100644
--- a/ceilometerclient/tests/v2/test_shell.py
+++ b/ceilometerclient/tests/v2/test_shell.py
@@ -1124,45 +1124,51 @@ class ShellEventListCommandTest(utils.BaseTestCase):
class ShellShadowedArgsTest(test_shell.ShellTestBase):
- def _test_project_id_alarm(self, command, args, method):
+ def _test_shadowed_args_alarm(self, command, args, method):
self.make_env(test_shell.FAKE_V2_ENV)
cli_args = [
'--os-project-id', '0ba30185ddf44834914a0b859d244c56',
+ '--os-user-id', '85f59b3b17484ccb974c50596023bf8c',
'--debug', command,
'--project-id', 'the-project-id-i-want-to-set',
+ '--user-id', 'the-user-id-i-want-to-set',
'--name', 'project-id-test'] + args
with mock.patch.object(alarms.AlarmManager, method) as mocked:
base_shell.main(cli_args)
args, kwargs = mocked.call_args
self.assertEqual('the-project-id-i-want-to-set',
kwargs.get('project_id'))
+ self.assertEqual('the-user-id-i-want-to-set',
+ kwargs.get('user_id'))
- def test_project_id_threshold_alarm(self):
+ def test_shadowed_args_threshold_alarm(self):
cli_args = ['--meter-name', 'cpu', '--threshold', '90']
- self._test_project_id_alarm('alarm-create', cli_args, 'create')
- self._test_project_id_alarm('alarm-threshold-create',
- cli_args, 'create')
+ self._test_shadowed_args_alarm('alarm-create', cli_args, 'create')
+ self._test_shadowed_args_alarm('alarm-threshold-create',
+ cli_args, 'create')
cli_args += ['--alarm_id', '437b7ed0-3733-4054-a877-e9a297b8be85']
- self._test_project_id_alarm('alarm-update', cli_args, 'update')
- self._test_project_id_alarm('alarm-threshold-update',
- cli_args, 'update')
+ self._test_shadowed_args_alarm('alarm-update', cli_args, 'update')
+ self._test_shadowed_args_alarm('alarm-threshold-update',
+ cli_args, 'update')
- def test_project_id_combination_alarm(self):
+ def test_shadowed_args_combination_alarm(self):
cli_args = ['--alarm_ids', 'fb16a05a-669d-414e-8bbe-93aa381df6a8',
'--alarm_ids', 'b189bcca-0a7b-49a9-a244-a927ac291881']
- self._test_project_id_alarm('alarm-combination-create',
- cli_args, 'create')
+ self._test_shadowed_args_alarm('alarm-combination-create',
+ cli_args, 'create')
cli_args += ['--alarm_id', '437b7ed0-3733-4054-a877-e9a297b8be85']
- self._test_project_id_alarm('alarm-combination-update',
- cli_args, 'update')
+ self._test_shadowed_args_alarm('alarm-combination-update',
+ cli_args, 'update')
@mock.patch.object(samples.OldSampleManager, 'create')
- def test_project_id_sample_create(self, mocked):
+ def test_shadowed_args_sample_create(self, mocked):
self.make_env(test_shell.FAKE_V2_ENV)
cli_args = [
'--os-project-id', '0ba30185ddf44834914a0b859d244c56',
+ '--os-user-id', '85f59b3b17484ccb974c50596023bf8c',
'--debug', 'sample-create',
'--project-id', 'the-project-id-i-want-to-set',
+ '--user-id', 'the-user-id-i-want-to-set',
'--resource-id', 'b666633d-9bb6-4e05-89c0-ee5a8752fb0b',
'--meter-name', 'cpu',
'--meter-type', 'cumulative',
@@ -1173,3 +1179,5 @@ class ShellShadowedArgsTest(test_shell.ShellTestBase):
args, kwargs = mocked.call_args
self.assertEqual('the-project-id-i-want-to-set',
kwargs.get('project_id'))
+ self.assertEqual('the-user-id-i-want-to-set',
+ kwargs.get('user_id'))