def __init__(self, shopid, secretkey): self.configuration = Configuration.instantiate() self.shop_id = shopid self.shop_password = secretkey self.auth_token = self.configuration.auth_token self.timeout = self.configuration.timeout self.max_attempts = self.configuration.max_attempts
def test_configuration(self): Configuration.configure(account_id='test_account', secret_key='test_key', timeout=1000, max_attempts=2) configuration = Configuration.instantiate() self.assertEqual(configuration.account_id, 'test_account') self.assertEqual(configuration.secret_key, 'test_key') self.assertEqual(configuration.timeout, 1000) self.assertEqual(configuration.max_attempts, 2)
def __init__(self): self.configuration = Configuration.instantiate() self.shop_id = self.configuration.account_id self.shop_password = self.configuration.secret_key self.auth_token = self.configuration.auth_token self.timeout = self.configuration.timeout self.max_attempts = self.configuration.max_attempts self.user_agent = UserAgent() if self.configuration.agent_framework: self.user_agent.framework = self.configuration.agent_framework if self.configuration.agent_cms: self.user_agent.cms = self.configuration.agent_cms if self.configuration.agent_module: self.user_agent.module = self.configuration.agent_module
def test_empty_credentials(self): with self.assertRaises(ConfigurationError): Configuration.configure(account_id=None, secret_key=None) configuration = Configuration.instantiate()
def __init__(self): self.configuration = Configuration.instantiate() self.shop_id = self.configuration.account_id self.shop_password = self.configuration.secret_key self.timeout = self.configuration.timeout self.max_attempts = self.configuration.max_attempts