def test_passes_along_the_default_probability(self): chaos.handler(None, mock.Mock()) self.get_default_probability.assert_called_once_with() self.chaos_lambda.assert_called_once_with( mock.ANY, self.get_default_probability.return_value )
def test_extracts_region_from_function_arn(self): context = mock.Mock() for region in ("eu-west-1", "sp-moonbase-1"): context.invoked_function_arn = "arn:aws:lambda:" + region + ":..." self.chaos_lambda.reset_mock() chaos.handler(None, context) self.chaos_lambda.assert_called_once_with(region)
def test_passes_along_the_region_list(self): context = mock.sentinel.context chaos.handler(None, context) self.get_regions.assert_called_once_with(context) self.chaos_lambda.assert_called_once_with( self.get_regions.return_value, mock.ANY )
def test_passes_along_the_default_probability(self): chaos.handler(None, mock.Mock()) self.get_default_probability.assert_called_once_with() self.chaos_lambda.assert_called_once_with( mock.ANY, self.get_default_probability.return_value)
def test_passes_along_the_region_list(self): context = mock.sentinel.context chaos.handler(None, context) self.get_regions.assert_called_once_with(context) self.chaos_lambda.assert_called_once_with( self.get_regions.return_value, mock.ANY)
def test_passes_along_the_default_probability(self): chaos.handler(None, mock.Mock()) self.chaos_lambda.assert_called_once_with(mock.ANY, self.DEFAULT_PROBABILITY)
def test_parseable_log_line_for_trigger(self): context = mock.Mock() context.invoked_function_arn = "arn:aws:lambda:sp-moonbase-1:..." chaos.handler(None, context) self.log.assert_called_once_with("triggered", "sp-moonbase-1")