diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-01-23 20:17:18 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-01-23 20:17:34 +0000 |
| commit | de55a714711a27207367bc8c5c8370549a9bd219 (patch) | |
| tree | 61765502ea99e740c2a6d1f7ab1391794e5f0e9d /tests/zips_tests.py | |
| parent | cd52af70959fa7a549f2283a36408e5144c19112 (diff) | |
Handle target URIs relative to the base
Diffstat (limited to 'tests/zips_tests.py')
| -rw-r--r-- | tests/zips_tests.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/zips_tests.py b/tests/zips_tests.py new file mode 100644 index 0000000..bef9895 --- /dev/null +++ b/tests/zips_tests.py @@ -0,0 +1,19 @@ +from nose.tools import istest, assert_equal + +from mammoth.zips 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"), + ) |
