Ejemplo n.º 1
0
def test_intercept_socket_intercepts_transported():
    request = Request(uri="/foo.sock/1/websocket/46327hfjew3?foo=bar")
    dispatcher.intercept_socket(request)

    expected = ('/foo.sock', '1/websocket/46327hfjew3')
    actual = (request.line.uri.path.decoded, request.socket)
    assert actual == expected, actual
Ejemplo n.º 2
0
def test_intercept_socket_intercepts_handshake():
    request = Request(uri="/foo.sock/1")
    dispatcher.intercept_socket(request)

    expected = ('/foo.sock', '1')
    actual = (request.line.uri.path.decoded, request.socket)
    assert actual == expected, actual