Exemplo n.º 1
0
def test_structure_headers():
    expected_response = Response(
        headers={"X-Clacks-Overhead": "GNU Terry Pratchett"})
    response_structure = expected_response.as_structure()
    response = Response.from_structure(response_structure)
    assert response.headers == expected_response.headers
Exemplo n.º 2
0
def test_structure_wait():
    expected_response = Response(wait=300)
    response_structure = expected_response.as_structure()
    response = Response.from_structure(response_structure)
    assert response.wait == expected_response.wait
Exemplo n.º 3
0
def test_structure_repeat():
    expected_response = Response(repeat=1)
    response_structure = expected_response.as_structure()
    response = Response.from_structure(response_structure)
    assert response.repeat == expected_response.repeat
Exemplo n.º 4
0
def test_structure_no_status():
    expected_response = Response()
    response_structure = expected_response.as_structure()
    del response_structure["is"]["statusCode"]
    response = Response.from_structure(response_structure)
    assert response.status_code == expected_response.status_code
Exemplo n.º 5
0
def test_structure_status():
    expected_response = Response(status_code=204)
    response_structure = expected_response.as_structure()
    response = Response.from_structure(response_structure)
    assert response.status_code == expected_response.status_code
Exemplo n.º 6
0
def test_structure_body():
    expected_response = Response(body="darwin")
    response_structure = expected_response.as_structure()
    response = Response.from_structure(response_structure)
    assert response.body == expected_response.body