libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [3/9] libcloud git commit: refactor the test to not call internal methods
Date Sat, 22 Apr 2017 02:35:16 GMT
refactor the test to not call internal methods


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

Branch: refs/heads/trunk
Commit: eaaf69900b59c98ba4e91123869a35f20af0d349
Parents: 3fd07eb
Author: Anthony Shaw <anthonyshaw@apache.org>
Authored: Sat Apr 22 08:05:26 2017 +1000
Committer: Anthony Shaw <anthonyshaw@apache.org>
Committed: Sat Apr 22 08:05:26 2017 +1000

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/eaaf6990/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index b42f43d..d00a467 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -69,10 +69,14 @@ class OpenStackAuthTests(unittest.TestCase):
             ex_tenant_name='admin')
         self.assertEqual(d._ex_force_auth_url, forced_auth)
         with requests_mock.Mocker() as mock:
+            body1 = ComputeFileFixtures('openstack').load('v1_slug_servers_ips.xml')
             body2 = ComputeFileFixtures('openstack').load('_v2_0__auth.json')
+
+            mock.register_uri('GET', 'https://test_endpoint.com/v2/1337/servers/test/ips',
text=body1,
+                              headers={'content-type': 'application/xml; charset=UTF-8'})
             mock.register_uri('POST', 'http://x.y.z.y:5000/v2.0/tokens', text=body2,
                               headers={'content-type': 'application/json; charset=UTF-8'})
-            d.connection._populate_hosts_and_request_paths()
+            d.ex_list_ip_addresses('test')
             self.assertEqual(d.connection.host, 'test_endpoint.com')
 
 


Mime
View raw message