def test_http_contradiction_error(self): """Establish that commands can not be ran with verify_ssl set to false and an http connection.""" with settings.runtime_values( host='http://33.33.33.33', verify_ssl=True): with self.assertRaises(exc.TowerCLIError): client.get_prefix()
def test_http_contradiction_error(self): """Establish that commands can not be ran with verify_ssl set to false and an http connection.""" with settings.runtime_values(host='http://33.33.33.33', verify_ssl=True): with self.assertRaises(exc.TowerCLIError): client.get_prefix()
def test_prefix_explicit_protocol(self): """Establish that the prefix property returns the appropriate URL prefix and don't clobber over an explicit protocol. """ with settings.runtime_values(host='bogus://33.33.33.33/'): self.assertEqual(client.get_prefix(), 'bogus://33.33.33.33/api/%s/' % CUR_API_VERSION)
def test_prefix_implicit_https(self): """Establish that the prefix property returns the appropriate URL prefix given a host with no specified protocol. """ with settings.runtime_values(host='33.33.33.33'): self.assertEqual(client.get_prefix(), 'https://33.33.33.33/api/%s/' % CUR_API_VERSION)
def test_prefix_http_protocol(self): """Establish that the http protocol works """ with settings.runtime_values(host='http://33.33.33.33', verify_ssl=False): self.assertEqual(client.get_prefix(), 'http://33.33.33.33/api/%s/' % CUR_API_VERSION)
def test_prefix_explicit_protocol(self): """Establish that the prefix property can not start with non-http protocol. """ with settings.runtime_values(host='bogus://33.33.33.33/'): with self.assertRaises(exc.ConnectionError): client.get_prefix()
def test_prefix_http_protocol(self): """Establish that the http protocol works """ with settings.runtime_values(host='http://33.33.33.33', verify_ssl=False): self.assertEqual(client.get_prefix(), 'http://33.33.33.33/api/%s/' % CUR_API_VERSION)
def test_prefix_implicit_https(self): """Establish that the prefix property returns the appropriate URL prefix given a host with no specified protocol. """ with settings.runtime_values(host='33.33.33.33'): self.assertEqual(client.get_prefix(), 'https://33.33.33.33/api/%s/' % CUR_API_VERSION)
def test_prefix_explicit_protocol(self): """Establish that the prefix property can not start with non-http protocol. """ with settings.runtime_values(host='bogus://33.33.33.33/'): with self.assertRaises(exc.ConnectionError): client.get_prefix()