diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-03-14 16:09:49 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-03-14 16:09:49 +0000 |
| commit | 2f6b48e0390a763438dc1bb084f4f6952535bde4 (patch) | |
| tree | 2497d97a93731e66cf0bbd207bff6d1b47981330 /openstackclient | |
| parent | 7449dae40a0391ea85d037703ff58e941afd7f8a (diff) | |
| parent | 7b2e3c7d1cbe6e55de4bf1d51cb4cc0862c60d44 (diff) | |
| download | python-openstackclient-2f6b48e0390a763438dc1bb084f4f6952535bde4.tar.gz | |
Merge "Use assertItemsEqual() instead of assertListEqual()"
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/tests/common/test_parseractions.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/openstackclient/tests/common/test_parseractions.py b/openstackclient/tests/common/test_parseractions.py index a4ee07bf..5c5ca3d3 100644 --- a/openstackclient/tests/common/test_parseractions.py +++ b/openstackclient/tests/common/test_parseractions.py @@ -91,11 +91,7 @@ class TestMultiKeyValueAction(utils.TestCase): {'req1': 'aaa', 'req2': 'bbb'}, {'req1': '', 'req2': ''}, ] - # Need to sort the lists before comparing them - key = lambda x: x['req1'] - expect.sort(key=key) - actual.sort(key=key) - self.assertListEqual(expect, actual) + self.assertItemsEqual(expect, actual) def test_empty_required_optional(self): self.parser.add_argument( @@ -119,11 +115,7 @@ class TestMultiKeyValueAction(utils.TestCase): {'req1': 'aaa', 'req2': 'bbb'}, {'req1': '', 'req2': ''}, ] - # Need to sort the lists before comparing them - key = lambda x: x['req1'] - expect.sort(key=key) - actual.sort(key=key) - self.assertListEqual(expect, actual) + self.assertItemsEqual(expect, actual) def test_error_values_with_comma(self): self.assertRaises( |
