100% test coverage for flow.py
This commit is contained in:
parent
1ad7e91527
commit
da1ccfddeb
|
@ -0,0 +1,2 @@
|
||||||
|
def request(ctx, r):
|
||||||
|
raise ValueError
|
|
@ -453,9 +453,19 @@ class uFlowMaster(libpry.AutoTree):
|
||||||
s = flow.State()
|
s = flow.State()
|
||||||
fm = flow.FlowMaster(None, s)
|
fm = flow.FlowMaster(None, s)
|
||||||
assert not fm.load_script("scripts/a.py")
|
assert not fm.load_script("scripts/a.py")
|
||||||
|
assert not fm.load_script("scripts/a.py")
|
||||||
|
assert not fm.load_script(None)
|
||||||
assert fm.load_script("nonexistent")
|
assert fm.load_script("nonexistent")
|
||||||
assert "ValueError" in fm.load_script("scripts/starterr.py")
|
assert "ValueError" in fm.load_script("scripts/starterr.py")
|
||||||
|
|
||||||
|
def test_script_reqerr(self):
|
||||||
|
s = flow.State()
|
||||||
|
fm = flow.FlowMaster(None, s)
|
||||||
|
assert not fm.load_script("scripts/reqerr.py")
|
||||||
|
req = tutils.treq()
|
||||||
|
fm.handle_clientconnect(req.client_conn)
|
||||||
|
f = fm.handle_request(req)
|
||||||
|
|
||||||
def test_script(self):
|
def test_script(self):
|
||||||
s = flow.State()
|
s = flow.State()
|
||||||
fm = flow.FlowMaster(None, s)
|
fm = flow.FlowMaster(None, s)
|
||||||
|
@ -494,11 +504,15 @@ class uFlowMaster(libpry.AutoTree):
|
||||||
assert not fm.handle_response(rx)
|
assert not fm.handle_response(rx)
|
||||||
|
|
||||||
dc = flow.ClientDisconnect(req.client_conn)
|
dc = flow.ClientDisconnect(req.client_conn)
|
||||||
|
req.client_conn.requestcount = 1
|
||||||
fm.handle_clientdisconnect(dc)
|
fm.handle_clientdisconnect(dc)
|
||||||
|
|
||||||
err = flow.Error(f.request, "msg")
|
err = flow.Error(f.request, "msg")
|
||||||
fm.handle_error(err)
|
fm.handle_error(err)
|
||||||
|
|
||||||
|
fm.load_script("scripts/a.py")
|
||||||
|
fm.shutdown()
|
||||||
|
|
||||||
def test_client_playback(self):
|
def test_client_playback(self):
|
||||||
s = flow.State()
|
s = flow.State()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue