def setup(self): """Setup before each method""" self._dispatcher = PagerDutyOutputV2(REGION, FUNCTION_NAME, CONFIG) remove_temp_secrets() output_name = self._dispatcher.output_cred_name(self.DESCRIPTOR) put_mock_creds(output_name, self.CREDS, self._dispatcher.secrets_bucket, REGION, KMS_ALIAS)
def setup(self, provider_constructor): """Setup before each method""" provider = MagicMock() provider_constructor.return_value = provider provider.load_credentials = Mock( side_effect=lambda x: self.CREDS if x == self.DESCRIPTOR else None) self._provider = provider self._dispatcher = PagerDutyOutputV2(None)
def setup(self): """Setup before each method""" self._mock_s3 = mock_s3() self._mock_s3.start() self._mock_kms = mock_kms() self._mock_kms.start() self._dispatcher = PagerDutyOutputV2(REGION, ACCOUNT_ID, FUNCTION_NAME, None) remove_temp_secrets() output_name = self._dispatcher.output_cred_name(self.DESCRIPTOR) put_mock_creds(output_name, self.CREDS, self._dispatcher.secrets_bucket, REGION, KMS_ALIAS)