Skip to content

Commit 2f6b48e

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Use assertItemsEqual() instead of assertListEqual()"
2 parents 7449dae + 7b2e3c7 commit 2f6b48e

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

openstackclient/tests/common/test_parseractions.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@ def test_good_values(self):
9191
{'req1': 'aaa', 'req2': 'bbb'},
9292
{'req1': '', 'req2': ''},
9393
]
94-
# Need to sort the lists before comparing them
95-
key = lambda x: x['req1']
96-
expect.sort(key=key)
97-
actual.sort(key=key)
98-
self.assertListEqual(expect, actual)
94+
self.assertItemsEqual(expect, actual)
9995

10096
def test_empty_required_optional(self):
10197
self.parser.add_argument(
@@ -119,11 +115,7 @@ def test_empty_required_optional(self):
119115
{'req1': 'aaa', 'req2': 'bbb'},
120116
{'req1': '', 'req2': ''},
121117
]
122-
# Need to sort the lists before comparing them
123-
key = lambda x: x['req1']
124-
expect.sort(key=key)
125-
actual.sort(key=key)
126-
self.assertListEqual(expect, actual)
118+
self.assertItemsEqual(expect, actual)
127119

128120
def test_error_values_with_comma(self):
129121
self.assertRaises(

0 commit comments

Comments
 (0)