Esempio n. 1
0
def test_jobs_destroy(mock_url, replay_session):
    """Destroy sends a DELETE and does not return anything."""
    exp_method = 'DELETE'
    exp_url = 'https://localhost:443/service/metronome/v1/jobs/myapp1'
    replay_session.queue([MockResponse({}, 200)])

    j = Jobs(default_url=mock_url)
    j.destroy('myapp1')

    assert replay_session.debug_cache[0] == ((exp_method, exp_url), {
        'params': {
            'stopCurrentJobRuns': 'true'
        }
    })
Esempio n. 2
0
def test_jobs_destroy_raise_error(mock_url, replay_session):
    replay_session.queue([MockResponse({}, 500)])

    j = Jobs(default_url=mock_url)
    with pytest.raises(HTTPError):
        j.destroy('myapp1')