Also assert on the exception error message, add additional test case.
@@ -68,8 +68,14 @@ class TestUtils(unittest.TestCase):
@patch.object(libcloud.requests, '__version__', '2.6.0')
@patch.object(libcloud.requests.packages.chardet, '__version__', '2.2.1')
- def test_detects_bad_yum_install_requests(self, *args):
- with self.assertRaises(AssertionError):
+ def test_init_once_detects_bad_yum_install_requests(self, *args):
+ expected_msg = 'Known bad version of requests detected'
+ with self.assertRaisesRegexp(AssertionError, expected_msg):
+ _init_once()
+
+ @patch.object(libcloud.requests, '__version__', '2.6.0')
+ @patch.object(libcloud.requests.packages.chardet, '__version__', '2.3.0')
+ def test_init_once_correct_chardet_version(self, *args):
_init_once()
