diff options
Diffstat (limited to 'novaclient')
-rw-r--r-- | novaclient/tests/functional/v2/test_servers.py | 2 | ||||
-rw-r--r-- | novaclient/tests/unit/test_shell.py | 2 | ||||
-rw-r--r-- | novaclient/tests/unit/utils.py | 1 | ||||
-rw-r--r-- | novaclient/tests/unit/v2/test_shell.py | 2 | ||||
-rw-r--r-- | novaclient/v2/shell.py | 9 |
5 files changed, 8 insertions, 8 deletions
diff --git a/novaclient/tests/functional/v2/test_servers.py b/novaclient/tests/functional/v2/test_servers.py index a25dd2ae..3de668dd 100644 --- a/novaclient/tests/functional/v2/test_servers.py +++ b/novaclient/tests/functional/v2/test_servers.py @@ -288,7 +288,7 @@ class TestServersDetailsFlavorInfo(base.ClientTestBase): flavor_details, key) server_flavor_val = self._get_value_from_the_table( server_details, flavor_key_mapping[key]) - if key is "swap" and flavor_val is "": + if key == "swap" and flavor_val == "": # "flavor-show" displays zero swap as empty string. flavor_val = '0' self.assertEqual(flavor_val, server_flavor_val) diff --git a/novaclient/tests/unit/test_shell.py b/novaclient/tests/unit/test_shell.py index 9ef6141f..2c6af3b4 100644 --- a/novaclient/tests/unit/test_shell.py +++ b/novaclient/tests/unit/test_shell.py @@ -433,7 +433,7 @@ class ShellTest(utils.TestCase): if required is None: required = [ '.*?^usage: ', - '.*?^\s+set-password\s+Change the admin password', + '.*?^\\s+set-password\\s+Change the admin password', '.*?^See "nova help COMMAND" for help on a specific command', ] stdout, stderr = self.shell(command) diff --git a/novaclient/tests/unit/utils.py b/novaclient/tests/unit/utils.py index 229d999e..f987fc3e 100644 --- a/novaclient/tests/unit/utils.py +++ b/novaclient/tests/unit/utils.py @@ -44,6 +44,7 @@ def _patch_mock_to_raise_for_invalid_assert_calls(): mock.Mock.__getattr__ = raise_for_invalid_assert_calls( mock.Mock.__getattr__) + # NOTE(gibi): needs to be called only once at import time # to patch the mock lib _patch_mock_to_raise_for_invalid_assert_calls() diff --git a/novaclient/tests/unit/v2/test_shell.py b/novaclient/tests/unit/v2/test_shell.py index 6c3b3cfa..2473061d 100644 --- a/novaclient/tests/unit/v2/test_shell.py +++ b/novaclient/tests/unit/v2/test_shell.py @@ -1062,7 +1062,7 @@ class ShellTest(utils.TestCase): cmd = ('boot --image %s --flavor 1 ' '--nic net-name=blank some-server' % FAKE_UUID_1) # this should raise a multiple matches error - msg = 'No Network matching blank\..*' + msg = 'No Network matching blank\\..*' with testtools.ExpectedException(exceptions.CommandError, msg): self.run_command(cmd) diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py index d8de74e8..773e6ce0 100644 --- a/novaclient/v2/shell.py +++ b/novaclient/v2/shell.py @@ -3112,11 +3112,10 @@ def _print_absolute_limits(limits): limit_list = [] for name in limit_names: - l = Limit(name, - used.get(name, "-"), - max.get(name, "-"), - other.get(name, "-")) - limit_list.append(l) + limit_list.append(Limit( + name, used.get(name, '-'), max.get(name, '-'), + other.get(name, '-'), + )) utils.print_list(limit_list, columns) |