summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authormelanie witt <melwittt@gmail.com>2021-07-27 02:10:20 +0000
committermelanie witt <melwittt@gmail.com>2021-07-27 02:20:39 +0000
commit4f6fe1c0fd0ee5be3cc78961fd334aac0bacd57b (patch)
treee420f11af87bf6876c5144174817c6e93da89ffd /openstackclient
parentc1209601b4f4b81690a186e51aa819c783367fae (diff)
downloadpython-openstackclient-4f6fe1c0fd0ee5be3cc78961fd334aac0bacd57b.tar.gz
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
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/tests/unit/compute/v2/test_server.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/openstackclient/tests/unit/compute/v2/test_server.py b/openstackclient/tests/unit/compute/v2/test_server.py
index c6dff5a8..42c8816b 100644
--- a/openstackclient/tests/unit/compute/v2/test_server.py
+++ b/openstackclient/tests/unit/compute/v2/test_server.py
@@ -4977,9 +4977,9 @@ class TestListMigrationV223(TestListMigration):
"""Test fetch all migrations. """
MIGRATION_COLUMNS = [
- 'Source Node', 'Dest Node', 'Source Compute',
- 'Dest Compute', 'Dest Host', 'Status', 'Server UUID',
- 'Old Flavor', 'New Flavor', 'Created At', 'Updated At'
+ 'Id', 'Source Node', 'Dest Node', 'Source Compute', 'Dest Compute',
+ 'Dest Host', 'Status', 'Server UUID', 'Old Flavor', 'New Flavor',
+ 'Type', 'Created At', 'Updated At'
]
def setUp(self):
@@ -5006,9 +5006,6 @@ class TestListMigrationV223(TestListMigration):
self.migrations_mock.list.assert_called_with(**kwargs)
- self.MIGRATION_COLUMNS.insert(0, "Id")
- self.MIGRATION_COLUMNS.insert(
- len(self.MIGRATION_COLUMNS) - 2, 'Type')
self.assertEqual(self.MIGRATION_COLUMNS, columns)
self.assertEqual(tuple(self.data), tuple(data))