Exemplo n.º 1
0
    def test_without_parameters(self):
        with patch.object(healthcheck, 'run') as mocked_run:
            mocked_run.return_value = 'WORKING'
            healthcheck.do_healthcheck('http://test.com')

        mocked_run.assert_called_once_with(
            'curl -L http://test.com/healthcheck')
Exemplo n.º 2
0
    def test_with_custom_body(self):
        with patch.object(healthcheck, 'run') as mocked_run:
            mocked_run.return_value = 'DERPING'
            healthcheck.do_healthcheck('http://test.com', body='DERPING')

        mocked_run.assert_called_once_with(
            'curl -L http://test.com/healthcheck')
Exemplo n.º 3
0
    def test_with_custom_uri(self):
        with patch.object(healthcheck, 'run') as mocked_run:
            mocked_run.return_value = 'WORKING'
            healthcheck.do_healthcheck('http://test.com', uri='derpcheck')

        mocked_run.assert_called_once_with('curl -L http://test.com/derpcheck')
Exemplo n.º 4
0
    def test_without_parameters(self):
        with patch.object(healthcheck, 'run') as mocked_run:
            mocked_run.return_value = 'WORKING'
            healthcheck.do_healthcheck('http://test.com')

        mocked_run.assert_called_once_with('curl -L http://test.com/healthcheck')
Exemplo n.º 5
0
    def test_with_custom_body(self):
        with patch.object(healthcheck, 'run') as mocked_run:
            mocked_run.return_value = 'DERPING'
            healthcheck.do_healthcheck('http://test.com', body='DERPING')

        mocked_run.assert_called_once_with('curl -L http://test.com/healthcheck')
Exemplo n.º 6
0
    def test_with_custom_uri(self):
        with patch.object(healthcheck, 'run') as mocked_run:
            mocked_run.return_value = 'WORKING'
            healthcheck.do_healthcheck('http://test.com', uri='derpcheck')

        mocked_run.assert_called_once_with('curl -L http://test.com/derpcheck')