Comment 1 for bug 1522551

Revision history for this message
Corey Bryant (corey.bryant) wrote :

This fixes it but there's probably something more elegant:

+if sys.version_info >= (3,0):
+ runtime_error = "builtins.RuntimeError"
+else:
+ runtime_error = "exceptions.RuntimeError"
+

 class SslutilsTestCase(base.ServiceBaseTestCase):
     """Test cases for sslutils."""
@@ -38,7 +44,7 @@
         self.key_file_name = os.path.join(SSL_CERT_DIR, 'privatekey.key')
         self.ca_file_name = os.path.join(SSL_CERT_DIR, 'ca.crt')

- @mock.patch("exceptions.RuntimeError")
+ @mock.patch(runtime_error)
     @mock.patch("os.path.exists")
     def test_is_enabled(self, exists_mock, runtime_error_mock):