fix FlowMaster.create_request, add test

This commit is contained in:
Maximilian Hils 2016-04-02 21:15:55 +02:00
parent d6e58bd16c
commit 610842cda5
2 changed files with 6 additions and 0 deletions

View File

@ -845,6 +845,7 @@ class FlowMaster(controller.Master):
s = ServerConnection.from_state(dict( s = ServerConnection.from_state(dict(
address=dict(address=(host, port), use_ipv6=False), address=dict(address=(host, port), use_ipv6=False),
peer_address=None,
cert=None, cert=None,
sni=host, sni=host,
source_address=dict(address=('', 0), use_ipv6=False), source_address=dict(address=('', 0), use_ipv6=False),

View File

@ -809,6 +809,11 @@ class TestFlowMaster:
assert s.flow_count() == 2 assert s.flow_count() == 2
assert s.index(f2) == 1 assert s.index(f2) == 1
def test_create_flow(self):
s = flow.State()
fm = flow.FlowMaster(None, s)
assert fm.create_request("GET", "http", "example.com", 80, "/")
def test_all(self): def test_all(self):
s = flow.State() s = flow.State()
fm = flow.FlowMaster(None, s) fm = flow.FlowMaster(None, s)