def setUp(self): ElasticLBMockHttp.test = self ElasticLBDriver.connectionCls.conn_classes = (None, ElasticLBMockHttp) ElasticLBMockHttp.type = None ElasticLBMockHttp.use_param = 'Action' self.driver = ElasticLBDriver(*LB_ELB_PARAMS)
def setUp(self): ElasticLBMockHttp.test = self ElasticLBDriver.connectionCls.conn_class = ElasticLBMockHttp ElasticLBMockHttp.type = None ElasticLBMockHttp.use_param = "Action" self.driver = ElasticLBDriver(*LB_ELB_PARAMS)
def test_instantiate_driver_with_token(self): token = "temporary_credentials_token" driver = ElasticLBDriver(*LB_ELB_PARAMS, **{"token": token}) self.assertTrue(hasattr(driver, "token"), "Driver has no attribute token") self.assertEqual(token, driver.token, "Driver token does not match with provided token")
def test_driver_with_token_signature_version(self): token = 'temporary_credentials_token' driver = ElasticLBDriver(*LB_ELB_PARAMS, **{'token': token}) kwargs = driver._ex_connection_class_kwargs() self.assertTrue(('signature_version' in kwargs), 'Driver has no attribute signature_version') self.assertEqual( '4', kwargs['signature_version'], 'Signature version is not 4 with temporary credentials')
def test_driver_with_token_signature_version(self): token = "temporary_credentials_token" driver = ElasticLBDriver(*LB_ELB_PARAMS, **{"token": token}) kwargs = driver._ex_connection_class_kwargs() self.assertTrue(("signature_version" in kwargs), "Driver has no attribute signature_version") self.assertEqual( "4", kwargs["signature_version"], "Signature version is not 4 with temporary credentials", )