Exemple #1
0
    def test_check_no_event_in_rule(self):
        msg = dict(event=gocd.Event.BREAKS, pipeline='p1')
        conf = dict(filter=dict(function='pipelines.in_group', args=['g1']),
                    actions=['mailto:[email protected]'])
        pipelines = gocd.Pipelines([{
            'name': 'g1',
            'pipelines': [{
                'name': 'p1'
            }]
        }])
        rule = gocd.GocdRule(conf)

        rcpts = rule.check(msg, dict(pipelines=pipelines))

        self.assertEqual(rcpts, conf['actions'])
Exemple #2
0
    def test_check_no_event(self):
        msg = dict(event=None, pipeline='p2')
        conf = dict(filter=dict(events=['FAILS', 'BREAKS'],
                                function='pipelines.in_group',
                                args=['g1']),
                    actions=['mailto:[email protected]'])
        pipelines = gocd.Pipelines([{
            'name': 'g1',
            'pipelines': [{
                'name': 'p1'
            }]
        }])
        rule = gocd.GocdRule(conf)

        rcpts = rule.check(msg, dict(pipelines=pipelines))

        self.assertEqual(rcpts, [])