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)
def test_parse_req_bad_len(message): """Test the length function in the parse request function.""" with pytest.raises(ValueError): parse_request(message)
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)
def test_server_parse_request_ok(message, result): """Test parse request function receives properly formatted request.""" assert parse_request(message) == result