From e78b48ab20a7250ccb50c878183ae68ea1748c40 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 9 Jun 2012 10:57:00 +1200 Subject: [PATCH] Start conversion to nose. RIP pry. --- test/.gitignore | 1 + test/test_server.py | 1 - test/test_utils.py | 266 +++++++++++++++++++------------------------- test/tutils.py | 39 +++++++ todo | 3 - 5 files changed, 156 insertions(+), 154 deletions(-) create mode 100644 test/.gitignore diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 000000000..6350e9868 --- /dev/null +++ b/test/.gitignore @@ -0,0 +1 @@ +.coverage diff --git a/test/test_server.py b/test/test_server.py index 3bfbab5bb..efd269eb1 100644 --- a/test/test_server.py +++ b/test/test_server.py @@ -1,6 +1,5 @@ import urllib, urllib2 import libpathod.test, requests -import libpry import tutils class uSanity(tutils.ProxTest): diff --git a/test/test_utils.py b/test/test_utils.py index 8bff03034..8a881b4e8 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1,202 +1,168 @@ import textwrap, re, json -import libpry from libmproxy import utils +from nose.tools import assert_raises +import tutils utils.CERT_SLEEP_TIME = 0 -class uformat_timestamp(libpry.AutoTree): - def test_simple(self): - assert utils.format_timestamp(utils.timestamp()) +def test_format_timestamp(): + assert utils.format_timestamp(utils.timestamp()) -class uisBin(libpry.AutoTree): - def test_simple(self): - assert not utils.isBin("testing\n\r") - assert utils.isBin("testing\x01") - assert utils.isBin("testing\x0e") - assert utils.isBin("testing\x7f") +def test_isBin(): + assert not utils.isBin("testing\n\r") + assert utils.isBin("testing\x01") + assert utils.isBin("testing\x0e") + assert utils.isBin("testing\x7f") -class uisXML(libpry.AutoTree): - def test_simple(self): - assert not utils.isXML("foo") - assert utils.isXML("