diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_text_parser.py | 23 | ||||
-rw-r--r-- | tests/test_utils.py | 22 |
2 files changed, 23 insertions, 22 deletions
diff --git a/tests/test_text_parser.py b/tests/test_text_parser.py index 3c61657..42a98d3 100644 --- a/tests/test_text_parser.py +++ b/tests/test_text_parser.py @@ -1,25 +1,4 @@ -from collections import namedtuple - -from epy import CharPos, TextMark, TextSpan, resolve_path, HTMLtoLines - - -def test_resolve_path(): - UnresolvedPath = namedtuple("UnresolvedPath", ["current_dir", "relative_path"]) - - inputs = [ - UnresolvedPath("/aaa/bbb/book.html", "../ccc.png"), - UnresolvedPath("/aaa/bbb/book.html", "../../ccc.png"), - UnresolvedPath("aaa/bbb/book.html", "../../ccc.png"), - ] - - expecteds = [ - "/aaa/ccc.png", - "/ccc.png", - "ccc.png", - ] - - for input, expected in zip(inputs, expecteds): - assert resolve_path(input.current_dir, input.relative_path) == expected +from epy import CharPos, TextMark, TextSpan, HTMLtoLines def test_mark_to_span(): diff --git a/tests/test_utils.py b/tests/test_utils.py new file mode 100644 index 0000000..4274adf --- /dev/null +++ b/tests/test_utils.py @@ -0,0 +1,22 @@ +from collections import namedtuple + +from epy import resolve_path + + +def test_resolve_path(): + UnresolvedPath = namedtuple("UnresolvedPath", ["current_dir", "relative_path"]) + + inputs = [ + UnresolvedPath("/aaa/bbb/book.html", "../ccc.png"), + UnresolvedPath("/aaa/bbb/book.html", "../../ccc.png"), + UnresolvedPath("aaa/bbb/book.html", "../../ccc.png"), + ] + + expecteds = [ + "/aaa/ccc.png", + "/ccc.png", + "ccc.png", + ] + + for input, expected in zip(inputs, expecteds): + assert resolve_path(input.current_dir, input.relative_path) == expected |