Skip to content

Commit 4f6fe1c

Browse files
committed
Fix TestListMigrationV223 test class MIGRATION_COLUMNS
Currently only the test_server_migration_list adds the 'Id' and 'Type' columns to the expected output, so if the test_server_migration_list_no_options test is run by itself, it fails as the actual response contains 'Id' and 'Type' but the reference does not. This example run fails: tox -epy38 test_server_migration_list_no_options The reason the tests pass in the gate is because test_server_migration_list (which adds the 'Id' and 'Type' columns to self.MIGRATION_COLUMNS) appears to always run before test_server_migration_list_no_options, so the latter test gets the benefit of the former test's column additions. This changes the test class to just include the 'Id' and 'Type' columns all the time as they are always returned in microversion 2.23 anyway. Story: 2009079 Task: 42891 Change-Id: I2c97e9f64790b5e978e4d04230d45b8e343b53d4
1 parent c120960 commit 4f6fe1c

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

openstackclient/tests/unit/compute/v2/test_server.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4977,9 +4977,9 @@ class TestListMigrationV223(TestListMigration):
49774977
"""Test fetch all migrations. """
49784978

49794979
MIGRATION_COLUMNS = [
4980-
'Source Node', 'Dest Node', 'Source Compute',
4981-
'Dest Compute', 'Dest Host', 'Status', 'Server UUID',
4982-
'Old Flavor', 'New Flavor', 'Created At', 'Updated At'
4980+
'Id', 'Source Node', 'Dest Node', 'Source Compute', 'Dest Compute',
4981+
'Dest Host', 'Status', 'Server UUID', 'Old Flavor', 'New Flavor',
4982+
'Type', 'Created At', 'Updated At'
49834983
]
49844984

49854985
def setUp(self):
@@ -5006,9 +5006,6 @@ def test_server_migration_list(self):
50065006

50075007
self.migrations_mock.list.assert_called_with(**kwargs)
50085008

5009-
self.MIGRATION_COLUMNS.insert(0, "Id")
5010-
self.MIGRATION_COLUMNS.insert(
5011-
len(self.MIGRATION_COLUMNS) - 2, 'Type')
50125009
self.assertEqual(self.MIGRATION_COLUMNS, columns)
50135010
self.assertEqual(tuple(self.data), tuple(data))
50145011

0 commit comments

Comments
 (0)