aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_console.py5
-rw-r--r--test/test_proxy.py2
-rw-r--r--test/test_utils.py8
3 files changed, 14 insertions, 1 deletions
diff --git a/test/test_console.py b/test/test_console.py
index 6252d8de..9236baff 100644
--- a/test/test_console.py
+++ b/test/test_console.py
@@ -108,13 +108,18 @@ class uformat_flow(libpry.AutoTree):
assert ('focus', '>> ') not in console.format_flow(f, False)
assert ('focus', '>> ') in console.format_flow(f, True)
+ assert ('focus', '>> ') not in console.format_flow(f, False, True)
+ assert ('focus', '>> ') in console.format_flow(f, True, True)
+
f.response = utils.tresp()
f.request = f.response.request
f.backup()
assert ('method', '[edited] ') in console.format_flow(f, True)
+ assert ('method', '[edited] ') in console.format_flow(f, True, True)
f.connection = flow.ReplayConnection()
assert ('method', '[replay] ') in console.format_flow(f, True)
+ assert ('method', '[replay] ') in console.format_flow(f, True, True)
class uPathCompleter(libpry.AutoTree):
diff --git a/test/test_proxy.py b/test/test_proxy.py
index ff9ec4bb..eaf73ee1 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -267,6 +267,8 @@ class uError(libpry.AutoTree):
state = e.get_state()
assert proxy.Error.from_state(state) == e
+ assert e.copy()
+
class uProxyError(libpry.AutoTree):
def test_simple(self):
diff --git a/test/test_utils.py b/test/test_utils.py
index f7c48c08..325664a4 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -1,8 +1,13 @@
-import textwrap, cStringIO, os
+import textwrap, cStringIO, os, time
import libpry
from libmproxy import utils
+class uformat_timestamp(libpry.AutoTree):
+ def test_simple(self):
+ assert utils.format_timestamp(time.time())
+
+
class uisBin(libpry.AutoTree):
def test_simple(self):
assert not utils.isBin("testing\n\r")
@@ -234,6 +239,7 @@ class uprettybody(libpry.AutoTree):
tests = [
+ uformat_timestamp(),
umake_bogus_cert(),
uisBin(),
uhexdump(),