diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2017-07-17 16:03:49 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2017-07-17 16:51:10 -0500 |
| commit | 2689984ba71fa0be25d2368277f33f2fb5c41266 (patch) | |
| tree | 59545576819e880f3fc02472ef97ee609ee4225d /openstackclient/tests/unit/compute | |
| parent | 2c57f7bfb2dc39afd361b85639df1ac4e1d417f5 (diff) | |
| download | python-openstackclient-2689984ba71fa0be25d2368277f33f2fb5c41266.tar.gz | |
Fix column names for server list --no-name-lookup
When --long is not present change the 'Image Name' column to
'Image' and add the 'Flavor' column. These columns will contain
Names unless --no-name-lookup is specified when they will contain IDs.
Change-Id: I92cfb22136aee32616894e60e9227b4da185da99
Diffstat (limited to 'openstackclient/tests/unit/compute')
| -rw-r--r-- | openstackclient/tests/unit/compute/v2/test_server.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/openstackclient/tests/unit/compute/v2/test_server.py b/openstackclient/tests/unit/compute/v2/test_server.py index 3e71ce07..b02b1491 100644 --- a/openstackclient/tests/unit/compute/v2/test_server.py +++ b/openstackclient/tests/unit/compute/v2/test_server.py @@ -1441,7 +1441,8 @@ class TestServerList(TestServer): 'Name', 'Status', 'Networks', - 'Image Name', + 'Image', + 'Flavor', ) columns_long = ( 'ID', @@ -1459,14 +1460,6 @@ class TestServerList(TestServer): 'Properties', ) - columns_no_name_lookup = ( - 'ID', - 'Name', - 'Status', - 'Image ID', - 'Flavor ID', - ) - def setUp(self): super(TestServerList, self).setUp() @@ -1546,6 +1539,7 @@ class TestServerList(TestServer): s.status, server._format_servers_list_networks(s.networks), self.image.name, + self.flavor.name, )) self.data_long.append(( s.id, @@ -1568,6 +1562,7 @@ class TestServerList(TestServer): s.id, s.name, s.status, + server._format_servers_list_networks(s.networks), s.image['id'], s.flavor['id'] )) @@ -1616,7 +1611,7 @@ class TestServerList(TestServer): columns, data = self.cmd.take_action(parsed_args) self.servers_mock.list.assert_called_with(**self.kwargs) - self.assertEqual(self.columns_no_name_lookup, columns) + self.assertEqual(self.columns, columns) self.assertEqual(tuple(self.data_no_name_lookup), tuple(data)) def test_server_list_n_option(self): @@ -1632,7 +1627,7 @@ class TestServerList(TestServer): columns, data = self.cmd.take_action(parsed_args) self.servers_mock.list.assert_called_with(**self.kwargs) - self.assertEqual(self.columns_no_name_lookup, columns) + self.assertEqual(self.columns, columns) self.assertEqual(tuple(self.data_no_name_lookup), tuple(data)) def test_server_list_with_image(self): |
