Exemplo n.º 1
0
def test_parse_req_bad_get(message):
    """If GET is bad, parse request function returns error code 405."""
    with pytest.raises(ValueError):
        parse_request(message)
Exemplo n.º 2
0
def test_parse_req_bad_len(message):
    """Test the length function in the parse request function."""
    with pytest.raises(ValueError):
        parse_request(message)
Exemplo n.º 3
0
def test_parse_req_bad_http(message):
    """If http is bad, parse request function returns error code 505."""
    with pytest.raises(ValueError):
        parse_request(message)
Exemplo n.º 4
0
def test_server_parse_request_ok(message, result):
    """Test parse request function receives properly formatted request."""
    assert parse_request(message) == result