Ubuntu Pastebin

Paste from smoser at Thu, 7 Dec 2017 21:20:08 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py
index feb884ab..baf5b99e 100644
--- a/cloudinit/tests/helpers.py
+++ b/cloudinit/tests/helpers.py
@@ -395,4 +395,9 @@ if not hasattr(mock.Mock, 'assert_not_called'):
     mock.Mock.assert_not_called = __mock_assert_not_called
 
 
+# older unittest2.TestCase (centos6) do not have assertRaisesRegex
+if not hasattr(unittest2.TestCase, 'assertRaisesRegex'):
+    unittest2.TestCase.assertRaisesRegex = unittest2.TestCase.assertRaisesRegexp
+
+
 # vi: ts=4 expandtab
Download as text