test to prove it's currently broken
@@ -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):
