summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/utils.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2020-11-04 16:16:58 +0000
committerStephen Finucane <sfinucan@redhat.com>2020-12-09 15:17:25 +0000
commitf5b185c35728025ebfd4145c800648b34476b775 (patch)
treeca90e0d63f5535aa20c6a32bb1f7c1a170abd4a7 /openstackclient/tests/unit/utils.py
parent0edd055f3f2a86a60226c342a617507ab94c5eaa (diff)
downloadpython-openstackclient-f5b185c35728025ebfd4145c800648b34476b775.tar.gz
Make use of comparable 'FormattableColumn' subclasses
This requires fixes found in cliff 3.5.0 [1] and osc-lib 2.3.0 [2]. With these fixes in place, we can remove the icky, still broken 'assertItemEqual' and 'assertListItemEqual' helpers. [1] https://review.opendev.org/761421 [2] https://review.opendev.org/761394 Change-Id: Id6c26b37c3c7d5ec6761361abca57f9219b76838 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/tests/unit/utils.py')
-rw-r--r--openstackclient/tests/unit/utils.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/openstackclient/tests/unit/utils.py b/openstackclient/tests/unit/utils.py
index 4130f18e..39cb5614 100644
--- a/openstackclient/tests/unit/utils.py
+++ b/openstackclient/tests/unit/utils.py
@@ -17,7 +17,6 @@
from io import StringIO
import os
-from cliff import columns as cliff_columns
import fixtures
import testtools
@@ -85,18 +84,3 @@ class TestCommand(TestCase):
self.assertIn(attr, parsed_args)
self.assertEqual(value, getattr(parsed_args, attr))
return parsed_args
-
- def assertListItemEqual(self, expected, actual):
- self.assertEqual(len(expected), len(actual))
- for item_expected, item_actual in zip(expected, actual):
- self.assertItemEqual(item_expected, item_actual)
-
- def assertItemEqual(self, expected, actual):
- self.assertEqual(len(expected), len(actual))
- for col_expected, col_actual in zip(expected, actual):
- if isinstance(col_expected, cliff_columns.FormattableColumn):
- self.assertIsInstance(col_actual, col_expected.__class__)
- self.assertEqual(col_expected.human_readable(),
- col_actual.human_readable())
- else:
- self.assertEqual(col_expected, col_actual)