Moved tests

This commit is contained in:
Ujjwal Verma 2017-08-14 18:35:40 +05:30 committed by Maximilian Hils
parent 1ad7b794d7
commit 0cb06b428e
18 changed files with 3 additions and 6 deletions

View File

View File

View File

@ -1,6 +1,6 @@
from mitmproxy.proxy2 import commands, events from mitmproxy.proxy2 import commands, events
from mitmproxy.proxy2.layers import tcp from mitmproxy.proxy2.layers import tcp
from mitmproxy.proxy2.test import tutils from .. import tutils
def test_open_connection(tctx): def test_open_connection(tctx):

View File

View File

@ -4,8 +4,8 @@ import pytest
from mitmproxy.proxy2 import commands, events from mitmproxy.proxy2 import commands, events
from mitmproxy.proxy2.layers import websocket from mitmproxy.proxy2.layers import websocket
from mitmproxy.proxy2.test import tutils
from mitmproxy.test import tflow from mitmproxy.test import tflow
from .. import tutils
@pytest.fixture @pytest.fixture
@ -74,12 +74,10 @@ def test_ping_pong(tctx, ws_playbook):
>> events.HookReply(-1, None) >> events.HookReply(-1, None)
>> events.DataReceived(tctx.client, b'\x89\x80\x10\x11\x12\x13') # Ping >> events.DataReceived(tctx.client, b'\x89\x80\x10\x11\x12\x13') # Ping
<< commands.Log("info", "Websocket PING received ") << commands.Log("info", "Websocket PING received ")
>> events.HookReply(-1, None)
<< commands.SendData(tctx.server, b'\x89\x80\x10\x11\x12\x13') << commands.SendData(tctx.server, b'\x89\x80\x10\x11\x12\x13')
<< commands.SendData(tctx.client, b'\x8a\x00') << commands.SendData(tctx.client, b'\x8a\x00')
>> events.DataReceived(tctx.server, b'\x8a\x00') # Pong >> events.DataReceived(tctx.server, b'\x8a\x00') # Pong
<< commands.Log("info", "Websocket PONG received ") << commands.Log("info", "Websocket PONG received ")
>> events.HookReply(-1, None)
) )
@ -134,7 +132,6 @@ def test_connection_closed(tctx, ws_playbook):
>> events.HookReply(-1, None) >> events.HookReply(-1, None)
>> events.ConnectionClosed(tctx.server) >> events.ConnectionClosed(tctx.server)
<< commands.Log("error", "Connection closed abnormally") << commands.Log("error", "Connection closed abnormally")
>> events.HookReply(-1, None)
<< commands.CloseConnection(tctx.client) << commands.CloseConnection(tctx.client)
<< commands.Hook("websocket_error", f) << commands.Hook("websocket_error", f)
>> events.HookReply(-1, None) >> events.HookReply(-1, None)

View File

View File

View File

View File

View File

View File

@ -4,7 +4,7 @@ import pytest
from mitmproxy.proxy2 import events, commands from mitmproxy.proxy2 import events, commands
from mitmproxy.proxy2.layer import Layer from mitmproxy.proxy2.layer import Layer
from mitmproxy.proxy2.test import tutils from . import tutils
class TEvent(events.Event): class TEvent(events.Event):

View File