From 1c45f5b05c7e066c28dfd4c9d1cde3b794f8983c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 23 Jul 2012 15:03:56 +1200 Subject: Use policy hook to apply a size limit in pathod, add corresponding cmdline arg. --- test/test_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/test_utils.py') diff --git a/test/test_utils.py b/test/test_utils.py index 72c892f0..8ca2da49 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1,6 +1,12 @@ from libpathod import utils import tutils +def test_parse_size(): + assert utils.parse_size("100") == 100 + assert utils.parse_size("100k") == 100 * 1024 + tutils.raises("invalid size spec", utils.parse_size, "foo") + tutils.raises("invalid size spec", utils.parse_size, "100kk") + def test_parse_anchor_spec(): assert utils.parse_anchor_spec("foo=200") == ("foo", "200") -- cgit v1.2.3