summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-11-21 16:50:51 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-11-21 16:50:51 -0800
commit6fac0f6ee9308782cafba65dfde7daafec4c563f (patch)
treeb86af96e49ee4d319e8eea1c6710b03d4a65080e /tests
parent97869ce751f81776ac5d57d1f566b419b836455f (diff)
parent7a24608072fb47ee9e40d8127b1f0f552bae0818 (diff)
downloadvyos-cloud-init-6fac0f6ee9308782cafba65dfde7daafec4c563f.tar.gz
vyos-cloud-init-6fac0f6ee9308782cafba65dfde7daafec4c563f.zip
Fix the digital ocean test on py2.6
The digital ocean datasource test is using assertIs which is only created/existent on py2.7, so for the older py2.6 we need to add similar logic so that the test works correctly there.
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/helpers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py
index 9700a4ca..52305397 100644
--- a/tests/unittests/helpers.py
+++ b/tests/unittests/helpers.py
@@ -35,6 +35,11 @@ else:
if PY26:
# For now add these on, taken from python 2.7 + slightly adjusted
class TestCase(unittest.TestCase):
+ def assertIs(self, expr1, expr2, msg=None):
+ if expr1 is not expr2:
+ standardMsg = '%r is not %r' % (expr1, expr2)
+ self.fail(self._formatMessage(msg, standardMsg))
+
def assertIn(self, member, container, msg=None):
if member not in container:
standardMsg = '%r not found in %r' % (member, container)