def __init__(self, service_name, region_name, account_id): self._config = get_config() self._service_name = service_name self._region_name = region_name self._account_id = account_id self._has_credentials = False if not aws_creds: # If no creds, need profile name to retrieve creds from ~/.aws/credentials self._profile = self._config['accounts'][account_id]['profile'] self._client = self._create_client() self._record_path = self._config.get('record_path', None)
def __init__(self, service_name, region_name, account_id, **kwargs): self._config = get_config() self._service_name = service_name self._region_name = region_name self._account_id = account_id self._has_credentials = False self.aws_creds = kwargs.get('aws_creds') if self.aws_creds is None: # no aws_creds, need profile to get creds from ~/.aws/credentials self._profile = self._config['accounts'][account_id]['profile'] self.placebo = kwargs.get('placebo') self.placebo_dir = kwargs.get('placebo_dir') self.placebo_mode = kwargs.get('placebo_mode', 'record') self._client = self._create_client()
def __init__(self, pattern, arn): self._accounts = get_config()['accounts'] super(Account, self).__init__(pattern, arn)
def test_get_accounts(self): self.assertIsNotNone(get_config()) self.assertEqual(4, len(get_accounts().keys())) self.assertIn("123456789012", get_accounts().keys())
def test_get_config(self): self.assertIsNotNone(get_config())