diff --git a/barbicanclient/tests/test_client.py b/barbicanclient/tests/test_client.py index 570b9ab5..b0269b23 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())