From 2689984ba71fa0be25d2368277f33f2fb5c41266 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Mon, 17 Jul 2017 16:03:49 -0500 Subject: 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 --- openstackclient/tests/unit/compute/v2/test_server.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'openstackclient/tests') 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): -- cgit v1.2.1