def test_that_when_creating_a_rule_fails_the_create_method_returns_error(self): ''' tests False when rule not created ''' self.conn.put_rule.side_effect = ClientError(error_content, 'put_rule') result = boto_cloudwatch_event.create_or_update(Name=rule_name, Description=rule_desc, ScheduleExpression=rule_sched, **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('put_rule'))
def test_that_when_creating_a_rule_succeeds_the_create_rule_method_returns_true(self): ''' tests True when rule created ''' self.conn.put_rule.return_value = create_rule_ret result = boto_cloudwatch_event.create_or_update(Name=rule_name, Description=rule_desc, ScheduleExpression=rule_sched, **conn_parameters) self.assertTrue(result['created'])
def test_that_when_creating_a_rule_fails_the_create_method_returns_error(self): ''' tests False when rule not created ''' self.conn.put_rule.side_effect = ClientError(error_content, 'put_rule') result = boto_cloudwatch_event.create_or_update(Name=rule_name, Description=rule_desc, ScheduleExpression=rule_sched, **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('put_rule'))
def test_that_when_creating_a_rule_succeeds_the_create_rule_method_returns_true(self): ''' tests True when rule created ''' self.conn.put_rule.return_value = create_rule_ret result = boto_cloudwatch_event.create_or_update(Name=rule_name, Description=rule_desc, ScheduleExpression=rule_sched, **conn_parameters) self.assertTrue(result['created'])
def test_that_when_creating_a_rule_fails_the_create_method_returns_error( self): """ tests False when rule not created """ self.conn.put_rule.side_effect = ClientError(error_content, "put_rule") result = boto_cloudwatch_event.create_or_update( Name=rule_name, Description=rule_desc, ScheduleExpression=rule_sched, **conn_parameters) assert result.get( "error", {}).get("message") == error_message.format("put_rule")