libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [1/5] libcloud git commit: test to prove it's currently broken
Date Tue, 10 Jan 2017 04:03:26 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk c8ba7fe0b -> 3dd6d0181


test to prove it's currently broken


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

Branch: refs/heads/trunk
Commit: 2f85baaffca0221bad9442a531e05acfed2ce887
Parents: c8ba7fe
Author: Anthony Shaw <anthonyshaw@apache.org>
Authored: Tue Jan 10 12:18:39 2017 +1100
Committer: Anthony Shaw <anthonyshaw@apache.org>
Committed: Tue Jan 10 12:18:39 2017 +1100

----------------------------------------------------------------------
 libcloud/test/test_connection.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/2f85baaf/libcloud/test/test_connection.py
----------------------------------------------------------------------
diff --git a/libcloud/test/test_connection.py b/libcloud/test/test_connection.py
index c6c770d..3c19c55 100644
--- a/libcloud/test/test_connection.py
+++ b/libcloud/test/test_connection.py
@@ -109,6 +109,24 @@ class BaseConnectionClassTestCase(unittest.TestCase):
         conn = LibcloudConnection(host='localhost', port=80)
         self.assertEqual(conn.host, 'http://localhost')
 
+    def test_secure_connection_unusual_port(self):
+        conn = Connection(secure=True, host='localhost', port=8081)
+        conn.connect()
+        self.assertEqual(conn.connection.host, 'https://localhost:8081')
+
+        conn2 = Connection(url='https://localhost:8081')
+        conn2.connect()
+        self.assertEqual(conn2.connection.host, 'https://localhost:8081')
+
+    def test_insecure_connection_unusual_port(self):
+        conn = Connection(secure=False, host='localhost', port=8081)
+        conn.connect()
+        self.assertEqual(conn.connection.host, 'http://localhost:8081')
+
+        conn2 = Connection(url='http://localhost:8081')
+        conn2.connect()
+        self.assertEqual(conn2.connection.host, 'http://localhost:8081')
+
 
 class ConnectionClassTestCase(unittest.TestCase):
     def setUp(self):


Mime
View raw message