diff options
Diffstat (limited to 'ceilometerclient/tests/unit')
-rw-r--r-- | ceilometerclient/tests/unit/test_client.py | 10 | ||||
-rw-r--r-- | ceilometerclient/tests/unit/test_shell.py | 18 |
2 files changed, 15 insertions, 13 deletions
diff --git a/ceilometerclient/tests/unit/test_client.py b/ceilometerclient/tests/unit/test_client.py index 2beaf73..400e997 100644 --- a/ceilometerclient/tests/unit/test_client.py +++ b/ceilometerclient/tests/unit/test_client.py @@ -43,8 +43,9 @@ class ClientTest(utils.BaseTestCase): def create_client(env, api_version=2, endpoint=None, exclude=[]): env = dict((k, v) for k, v in env.items() if k not in exclude) - with mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', - return_value=None): + with mock.patch( + 'ceilometerclient.v2.client.Client._get_redirect_client', + return_value=None): return client.get_client(api_version, **env) def test_client_v2_with_session(self): @@ -184,8 +185,9 @@ class ClientTest2(ClientTest): def create_client(env, api_version=2, endpoint=None, exclude=[]): env = dict((k, v) for k, v in env.items() if k not in exclude) - with mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', - return_value=None): + with mock.patch( + 'ceilometerclient.v2.client.Client._get_redirect_client', + return_value=None): return client.Client(api_version, endpoint, **env) diff --git a/ceilometerclient/tests/unit/test_shell.py b/ceilometerclient/tests/unit/test_shell.py index 41f6f54..d666594 100644 --- a/ceilometerclient/tests/unit/test_shell.py +++ b/ceilometerclient/tests/unit/test_shell.py @@ -112,7 +112,7 @@ class ShellBashCompletionTest(ShellTestBase): class ShellKeystoneV2Test(ShellTestBase): @mock.patch.object(ks_session, 'Session') - @mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', + @mock.patch('ceilometerclient.v2.client.Client._get_redirect_client', mock.Mock(return_value=None)) def test_debug_switch_raises_error(self, mock_ksclient): mock_ksclient.side_effect = exc.HTTPUnauthorized @@ -121,7 +121,7 @@ class ShellKeystoneV2Test(ShellTestBase): self.assertRaises(exc.CommandError, ceilometer_shell.main, args) @mock.patch.object(ks_session, 'Session') - @mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', + @mock.patch('ceilometerclient.v2.client.Client._get_redirect_client', mock.Mock(return_value=None)) def test_dash_d_switch_raises_error(self, mock_ksclient): mock_ksclient.side_effect = exc.CommandError("FAIL") @@ -141,7 +141,7 @@ class ShellKeystoneV2Test(ShellTestBase): class ShellKeystoneV3Test(ShellTestBase): @mock.patch.object(ks_session, 'Session') - @mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', + @mock.patch('ceilometerclient.v2.client.Client._get_redirect_client', mock.Mock(return_value=None)) def test_debug_switch_raises_error(self, mock_ksclient): mock_ksclient.side_effect = exc.HTTPUnauthorized @@ -194,7 +194,7 @@ class ShellTimeoutTest(ShellTestBase): self._test_timeout('0', expected_msg) @mock.patch.object(ks_session, 'Session') - @mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', + @mock.patch('ceilometerclient.v2.client.Client._get_redirect_client', mock.Mock(return_value=None)) def test_timeout_keystone_session(self, mocked_session): mocked_session.side_effect = exc.HTTPUnauthorized("FAIL") @@ -208,7 +208,7 @@ class ShellTimeoutTest(ShellTestBase): class ShellInsecureTest(ShellTestBase): @mock.patch.object(api_client, 'HTTPClient') - @mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', + @mock.patch('ceilometerclient.v2.client.Client._get_redirect_client', mock.Mock(return_value=None)) def test_insecure_true_ceilometer(self, mocked_client): self.make_env(FAKE_V2_ENV) @@ -218,7 +218,7 @@ class ShellInsecureTest(ShellTestBase): self.assertFalse(kwargs.get('verify')) @mock.patch.object(ks_session, 'Session') - @mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', + @mock.patch('ceilometerclient.v2.client.Client._get_redirect_client', mock.Mock(return_value=None)) def test_insecure_true_keystone(self, mocked_session): mocked_session.side_effect = exc.HTTPUnauthorized("FAIL") @@ -229,7 +229,7 @@ class ShellInsecureTest(ShellTestBase): self.assertFalse(kwargs.get('verify')) @mock.patch.object(api_client, 'HTTPClient') - @mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', + @mock.patch('ceilometerclient.v2.client.Client._get_redirect_client', mock.Mock(return_value=None)) def test_insecure_false_ceilometer(self, mocked_client): self.make_env(FAKE_V2_ENV) @@ -239,7 +239,7 @@ class ShellInsecureTest(ShellTestBase): self.assertTrue(kwargs.get('verify')) @mock.patch.object(ks_session, 'Session') - @mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', + @mock.patch('ceilometerclient.v2.client.Client._get_redirect_client', mock.Mock(return_value=None)) def test_insecure_false_keystone(self, mocked_session): mocked_session.side_effect = exc.HTTPUnauthorized("FAIL") @@ -270,7 +270,7 @@ class ShellEndpointTest(ShellTestBase): class ShellAlarmUpdateRepeatAction(ShellTestBase): @mock.patch('ceilometerclient.v2.alarms.AlarmManager.update') - @mock.patch('ceilometerclient.v2.client.Client._get_alarm_client', + @mock.patch('ceilometerclient.v2.client.Client._get_redirect_client', mock.Mock()) def test_repeat_action_not_specified(self, mocked): self.make_env(FAKE_V2_ENV) |