diff options
| author | Jamie Lennox <jlennox@redhat.com> | 2013-05-21 14:31:50 +1000 |
|---|---|---|
| committer | Jamie Lennox <jlennox@redhat.com> | 2013-05-21 15:27:46 +1000 |
| commit | fe57d6de5b82a8b2ae07bfb136a7b17183c04cbb (patch) | |
| tree | ab4b7a4c68248b6783a5c0e80d7a675102acdb18 /keystone | |
| parent | 8d2b8e6457d5ae0ed1136091cb8c143a96abd614 (diff) | |
Add assertNotEmpty to tests and use it.
Extract the use of assertTrue(len(...)) into a method. The docs for
assertTrue say that it equates to bool(expr) is True and so the format
is correct however it reads inconsistently.
Change-Id: I75acf75f6eaac9b7f92fd452cc60ab0cfd447c7f
Diffstat (limited to 'keystone')
| -rw-r--r-- | keystone/test.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/keystone/test.py b/keystone/test.py index f47c253c..497a59bc 100644 --- a/keystone/test.py +++ b/keystone/test.py @@ -341,6 +341,9 @@ class TestCase(NoModule, unittest.TestCase): """ self.assertAlmostEqual(a, b, delta=datetime.timedelta(seconds=delta)) + def assertNotEmpty(self, l): + self.assertTrue(len(l)) + def assertDictContainsSubset(self, dict1, dict2): if len(dict1) < len(dict2): (subset, fullset) = dict1, dict2 |
