Ejemplo n.º 1
0
def test_confirm_upload_ok():
    url = 'http://localhost:5000/builds/1'

    responses.add(responses.PATCH, url, json={'uploaded': True}, status=200)

    _confirm_upload('http://localhost:5000/builds/1', 'token')
    assert len(responses.calls) == 1
    assert responses.calls[0].request.url == url
Ejemplo n.º 2
0
def test_confirm_upload_ok():
    url = 'http://localhost:5000/builds/1'

    responses.add(
        responses.PATCH,
        url,
        json={'uploaded': True},
        status=200)

    _confirm_upload('http://localhost:5000/builds/1', 'token')
    assert len(responses.calls) == 1
    assert responses.calls[0].request.url == url
Ejemplo n.º 3
0
def test_confirm_upload_failed():
    """Check that an exception is raised when keeper does not return 200
    on an upload confirmation reques.
    """
    url = 'http://localhost:5000/builds/1'

    responses.add(responses.PATCH, url, json={'uploaded': True}, status=404)

    with pytest.raises(KeeperError):
        _confirm_upload('http://localhost:5000/builds/1', 'token')
    assert len(responses.calls) == 1
    assert responses.calls[0].request.url == url
Ejemplo n.º 4
0
def test_confirm_upload_failed():
    """Check that an exception is raised when keeper does not return 200
    on an upload confirmation reques.
    """
    url = 'http://localhost:5000/builds/1'

    responses.add(
        responses.PATCH,
        url,
        json={'uploaded': True},
        status=404)

    with pytest.raises(KeeperError):
        _confirm_upload('http://localhost:5000/builds/1', 'token')
    assert len(responses.calls) == 1
    assert responses.calls[0].request.url == url