Exemple #1
0
    def integration_02a_test_unpause(self):

        actor = pingdom.Unpause('Unpause check', {'name': self.check_name})

        yield actor.execute()

        yield utils.tornado_sleep(30)  # Let Pingdom cache settle

        check = yield actor._get_check()

        self.assertEqual(check['status'], 'up')
Exemple #2
0
    def test_execute_dry(self):
        actor = pingdom.Unpause('Unit Test Action', {'name': 'lollipop'},
                                dry=True)

        actor._pingdom_client = mock.Mock()
        actor._get_check = mock_tornado({
            'name': 'lollipop',
            'hostname': 'http://lollipop.com',
            'id': 'lol'
        })

        yield actor._execute()

        self.assertEquals(actor._get_check._call_count, 1)
        actor._pingdom_client.check().http_put.assert_not_called()
Exemple #3
0
    def test_execute(self):
        actor = pingdom.Unpause('Unit Test Action', {'name': 'lollipop'})

        actor._pingdom_client = mock.Mock()
        actor._get_check = mock_tornado({
            'name': 'lollipop',
            'hostname': 'http://lollipop.com',
            'id': 'lol'
        })
        actor._pingdom_client.check().http_put.return_value = tornado_value()

        yield actor._execute()

        self.assertEquals(actor._get_check._call_count, 1)
        actor._pingdom_client.check.assert_called_with(check_id='lol')
        actor._pingdom_client.check().http_put.assert_called_with(
            paused='false')