From e608d10f455550b8afd09217f0ecf344a0bdc814 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 3 Mar 2013 12:26:20 +1300 Subject: Remove __slots__ to make it possible to inherit from Options classes. --- test/test_dump.py | 1 - 1 file changed, 1 deletion(-) (limited to 'test/test_dump.py') diff --git a/test/test_dump.py b/test/test_dump.py index 5d3f9133..1b434f81 100644 --- a/test/test_dump.py +++ b/test/test_dump.py @@ -101,7 +101,6 @@ class TestDumpMaster: def test_options(self): o = dump.Options(verbosity = 2) assert o.verbosity == 2 - libpry.raises(AttributeError, dump.Options, nonexistent = 2) def test_filter(self): assert not "GET" in self._dummy_cycle(1, "~u foo", "", verbosity=1) -- cgit v1.2.3 From cde66cd58470cd68a76a9d8b1022a45e99a5cd8d Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 3 Mar 2013 22:03:27 +1300 Subject: Fuzzing, and fixes for errors found with fuzzing. --- test/test_dump.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'test/test_dump.py') diff --git a/test/test_dump.py b/test/test_dump.py index 1b434f81..7992f78e 100644 --- a/test/test_dump.py +++ b/test/test_dump.py @@ -1,6 +1,5 @@ import os from cStringIO import StringIO -import libpry from libmproxy import dump, flow, proxy import tutils import mock @@ -65,7 +64,7 @@ class TestDumpMaster: cs = StringIO() o = dump.Options(server_replay="nonexistent", kill=True) - libpry.raises(dump.DumpError, dump.DumpMaster, None, o, None, outfile=cs) + tutils.raises(dump.DumpError, dump.DumpMaster, None, o, None, outfile=cs) with tutils.tmpdir() as t: p = os.path.join(t, "rep") @@ -90,7 +89,7 @@ class TestDumpMaster: self._flowfile(p) assert "GET" in self._dummy_cycle(0, None, "", verbosity=1, rfile=p) - libpry.raises( + tutils.raises( dump.DumpError, self._dummy_cycle, 0, None, "", verbosity=1, rfile="/nonexistent" ) @@ -130,7 +129,7 @@ class TestDumpMaster: assert len(list(flow.FlowReader(open(p)).stream())) == 1 def test_write_err(self): - libpry.raises( + tutils.raises( dump.DumpError, self._dummy_cycle, 1, @@ -148,11 +147,11 @@ class TestDumpMaster: assert "XREQUEST" in ret assert "XRESPONSE" in ret assert "XCLIENTDISCONNECT" in ret - libpry.raises( + tutils.raises( dump.DumpError, self._dummy_cycle, 1, None, "", script="nonexistent" ) - libpry.raises( + tutils.raises( dump.DumpError, self._dummy_cycle, 1, None, "", script="starterr.py" ) -- cgit v1.2.3 From d2d3eb6490a6b342f8d205e26d04c913b8e2a5f7 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 17 Mar 2013 17:53:39 +1300 Subject: Un-break unit tests. Tsk tsk. --- test/test_dump.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/test_dump.py') diff --git a/test/test_dump.py b/test/test_dump.py index 7992f78e..94d0b195 100644 --- a/test/test_dump.py +++ b/test/test_dump.py @@ -12,8 +12,10 @@ def test_strfuncs(): t = tutils.treq() t.client_conn = None t.stickycookie = True - assert "stickycookie" in dump.str_request(t) - assert "replay" in dump.str_request(t) + assert "stickycookie" in dump.str_request(t, False) + assert "stickycookie" in dump.str_request(t, True) + assert "replay" in dump.str_request(t, False) + assert "replay" in dump.str_request(t, True) class TestDumpMaster: -- cgit v1.2.3