def test_report_event():
    with mock.patch('pysensu_yelp.send_event') as mock_call:
        report_event({'team': 'search_infra'})
        mock_call.assert_called_with(team='search_infra')

        with pytest.raises(Exception):
            report_event({'foo': 'bar'})
Example #2
0
def test_report_event():
    with mock.patch('pysensu_yelp.send_event', autospec=True) as mock_call:
        report_event({
            'team': 'search_infra',
            'name': 'Fake Event',
            'runbook': 'Fake Runbook',
            'output': 'Foo',
            'status': 'OK',
        })
        mock_call.assert_called_with(
            team='search_infra',
            name='Fake Event',
            runbook='Fake Runbook',
            output='Foo',
            status='OK',
        )

        with pytest.raises(Exception):
            report_event({'foo': 'bar'})
def test_report_event():
    with mock.patch('pysensu_yelp.send_event', autospec=True) as mock_call:
        report_event({
            'team': 'search_infra',
            'name': 'Fake Event',
            'runbook': 'Fake Runbook',
            'output': 'Foo',
            'status': 'OK',
        }
        )
        mock_call.assert_called_with(
            team='search_infra',
            name='Fake Event',
            runbook='Fake Runbook',
            output='Foo',
            status='OK',
        )

        with pytest.raises(Exception):
            report_event({'foo': 'bar'})