You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2017/04/22 02:35:20 UTC

[7/9] libcloud git commit: write teardowns for openstack tests

write teardowns for openstack tests


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/9be9f9f2
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/9be9f9f2
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/9be9f9f2

Branch: refs/heads/trunk
Commit: 9be9f9f22c8f7714afc62ba0cb02d13dd044e687
Parents: a28a079
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 22 12:20:06 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 22 12:20:06 2017 +1000

----------------------------------------------------------------------
 libcloud/test/common/test_openstack.py  | 5 ++++-
 libcloud/test/compute/test_openstack.py | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/9be9f9f2/libcloud/test/common/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/common/test_openstack.py b/libcloud/test/common/test_openstack.py
index 6780aa6..b5e9341 100644
--- a/libcloud/test/common/test_openstack.py
+++ b/libcloud/test/common/test_openstack.py
@@ -17,7 +17,7 @@ import sys
 import unittest
 
 from mock import Mock
-
+from libcloud.common.base import LibcloudConnection
 from libcloud.common.openstack import OpenStackBaseConnection
 from libcloud.utils.py3 import PY25
 
@@ -32,6 +32,9 @@ class OpenStackBaseConnectionTest(unittest.TestCase):
         self.connection.driver = Mock()
         self.connection.driver.name = 'OpenStackDriver'
 
+    def tearDown(self):
+        OpenStackBaseConnection.conn_class = LibcloudConnection
+
     def test_base_connection_timeout(self):
         self.connection.connect()
         self.assertEqual(self.connection.timeout, self.timeout)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/9be9f9f2/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index b6b6917..77d35e6 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -33,6 +33,7 @@ from libcloud.utils.py3 import httplib
 from libcloud.utils.py3 import method_type
 from libcloud.utils.py3 import u
 
+from libcloud.common.base import LibcloudConnection
 from libcloud.common.types import InvalidCredsError, MalformedResponseError, \
     LibcloudError
 from libcloud.compute.types import Provider, KeyPairDoesNotExistError, StorageVolumeState, \
@@ -60,6 +61,7 @@ BASE_DIR = os.path.abspath(os.path.split(__file__)[0])
 class OpenStackAuthTests(unittest.TestCase):
     def setUp(self):
         OpenStack_1_0_NodeDriver.connectionCls = OpenStack_1_0_Connection
+        OpenStack_1_0_NodeDriver.connectionCls.conn_class = LibcloudConnection
 
     def test_auth_host_passed(self):
         forced_auth = 'http://x.y.z.y:5000'