summaryrefslogtreecommitdiff
path: root/tests/zips_tests.py
blob: bef9895dbff54178c3c72ca934012984e6ccf6b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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"),
    )