コード例 #1
0
 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
コード例 #2
0
    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)
コード例 #3
0
    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
コード例 #4
0
 def test_empty_credentials(self):
     with self.assertRaises(ConfigurationError):
         Configuration.configure(account_id=None, secret_key=None)
         configuration = Configuration.instantiate()
コード例 #5
0
 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