mitmproxy/test/test_utils.py

22 lines
613 B
Python
Raw Normal View History

2012-04-28 00:42:03 +00:00
import libpry
from libpathod import utils
2012-04-29 00:05:38 +00:00
class uparse_anchor_spec(libpry.AutoTree):
def test_simple(self):
assert utils.parse_anchor_spec("foo=200", {}) == ("foo", "200")
libpry.raises(utils.AnchorError, utils.parse_anchor_spec, "foobar", {})
2012-04-29 00:05:38 +00:00
libpry.raises(utils.AnchorError, utils.parse_anchor_spec, "*=200", {})
libpry.raises(utils.AnchorError, utils.parse_anchor_spec, "foo=bar", {})
2012-04-28 00:42:03 +00:00
class udata_path(libpry.AutoTree):
def test_simple(self):
libpry.raises(ValueError, utils.data.path, "nonexistent")
2012-04-28 00:42:03 +00:00
tests = [
udata_path(),
2012-04-29 00:05:38 +00:00
uparse_anchor_spec()
2012-04-28 00:42:03 +00:00
]