diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_dump.py | 14 | ||||
-rw-r--r-- | test/test_flow.py | 4 | ||||
-rw-r--r-- | test/utils.py | 7 |
3 files changed, 20 insertions, 5 deletions
diff --git a/test/test_dump.py b/test/test_dump.py index 90540408..6213f870 100644 --- a/test/test_dump.py +++ b/test/test_dump.py @@ -26,19 +26,27 @@ class uDumpMaster(libpry.AutoTree): def test_replay(self): cs = StringIO() - o = dump.Options(replay="nonexistent") + o = dump.Options(replay="nonexistent", kill=True) libpry.raises(dump.DumpError, dump.DumpMaster, None, o, None, outfile=cs) t = self.tmpdir() p = os.path.join(t, "rep") f = open(p, "w") fw = flow.FlowWriter(f) - t = utils.tflow() + t = utils.tflow_full() + t.response = utils.tresp(t.request) fw.add(t) f.close() - o = dump.Options(replay=p) + o = dump.Options(replay=p, kill=True) m = dump.DumpMaster(None, o, None, outfile=cs) + + self._cycle(m, "content") + self._cycle(m, "content") + + o = dump.Options(replay=p, kill=False) + m = dump.DumpMaster(None, o, None, outfile=cs) + self._cycle(m, "nonexistent") def test_options(self): o = dump.Options(verbosity = 2) diff --git a/test/test_flow.py b/test/test_flow.py index cd88464d..4bfd5ad9 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -19,10 +19,10 @@ class uServerPlaybackState(libpry.AutoTree): def test_load(self): s = flow.ServerPlaybackState() - r = utils.tflow() + r = utils.tflow_full() r.request.headers["key"] = ["one"] - r2 = utils.tflow() + r2 = utils.tflow_full() r2.request.headers["key"] = ["two"] s.load([r, r2]) diff --git a/test/utils.py b/test/utils.py index 12646106..9a00983c 100644 --- a/test/utils.py +++ b/test/utils.py @@ -22,3 +22,10 @@ def tflow(): return flow.Flow(r) +def tflow_full(): + r = treq() + f = flow.Flow(r) + f.response = tresp(r) + return f + + |