diff options
author | Adam Harwell <flux.adam@gmail.com> | 2015-03-18 01:01:19 -0500 |
---|---|---|
committer | Adam Harwell <flux.adam@gmail.com> | 2015-03-18 01:01:19 -0500 |
commit | 3350af71244ca86199dc7b5391b4f634514dcf39 (patch) | |
tree | 73a088ce61d61453fcbd8698b6e4de4d3726d16c | |
parent | 2a27f57f5928bc414d7b88035abc1d2c9c4e94a1 (diff) | |
download | python-barbicanclient-3350af71244ca86199dc7b5391b4f634514dcf39.tar.gz |
Removing assertItemsEqual workaround, fixed upstream
Testtools switched to using unittest2 universally, which resolved the
inconsistencies with the assertItemsEqual function's availability. This
workaround code is no longer necessary.
Change-Id: Ic426e9fca7e475b9a42f14fff89eecaafb7937ba
-rw-r--r-- | barbicanclient/tests/test_client.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/barbicanclient/tests/test_client.py b/barbicanclient/tests/test_client.py index 570b9ab..b0269b2 100644 --- a/barbicanclient/tests/test_client.py +++ b/barbicanclient/tests/test_client.py @@ -250,38 +250,6 @@ class WhenTestingGetErrorMessage(TestClient): class BaseEntityResource(testtools.TestCase): - # TODO: The compatibility of unittest between versions is horrible - # Reported as https://bugs.launchpad.net/testtools/+bug/1373139 - if hasattr(testtools.TestCase, 'assertItemsEqual'): - # If this function is available, do nothing (PY27) - pass - elif hasattr(testtools.TestCase, 'assertCountEqual'): - # If this function is available, alias it (PY32+) - assertItemsEqual = testtools.TestCase.assertCountEqual - else: - # If neither is available, make our own version (PY26, PY30-31) - def assertItemsEqual(self, expected_seq, actual_seq, msg=None): - first_seq, second_seq = list(expected_seq), list(actual_seq) - differences = [] - for item in first_seq: - if item not in second_seq: - differences.append(item) - - for item in second_seq: - if item not in first_seq: - differences.append(item) - - if differences: - if not msg: - msg = "Items differ: {0}".format(differences) - self.fail(msg) - if len(first_seq) != len(second_seq): - if not msg: - msg = "Size of collection differs: {0} != {1}".format( - len(first_seq), len(second_seq) - ) - self.fail(msg) - def _setUp(self, entity, entity_id='abcd1234-eabc-5678-9abc-abcdef012345'): super(BaseEntityResource, self).setUp() self.responses = self.useFixture(fixture.Fixture()) |