From e23fe00ff2a8fb3c796bfcc600dcc58dba902fa5 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 23 Jan 2017 20:39:05 +0000 Subject: Move target URI handling out of zips module --- tests/docx/uris_tests.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/docx/uris_tests.py (limited to 'tests/docx') diff --git a/tests/docx/uris_tests.py b/tests/docx/uris_tests.py new file mode 100644 index 0000000..6b9c264 --- /dev/null +++ b/tests/docx/uris_tests.py @@ -0,0 +1,19 @@ +from nose.tools import istest, assert_equal + +from mammoth.docx.uris import uri_to_zip_entry_name + + +@istest +def when_path_does_not_have_leading_slash_then_path_is_resolved_relative_to_base(): + assert_equal( + "one/two/three/four", + uri_to_zip_entry_name("one/two", "three/four"), + ) + + +@istest +def when_path_has_leading_slash_then_base_is_ignored(): + assert_equal( + "three/four", + uri_to_zip_entry_name("one/two", "/three/four"), + ) -- cgit v1.2.3