예제 #1
0
def test_get_subpaths():
    for fname, expect in [("no/dbl/slash", ("no/dbl/slash", [])),
                          ("p1//n", ("p1/n", ["p1"])),
                          ("p1//p2/p3//n", ("p1/p2/p3/n",
                                            ["p1", "p1/p2/p3"])),
                          ("//n", ("/n", [""])),
                          ("n//", ("n/", ["n"]))]:
        eq_(au.get_subpaths(fname), expect)
예제 #2
0
파일: test_addurls.py 프로젝트: loj/datalad
def test_get_subpaths():
    for fname, expect in [("no/dbl/slash", ("no/dbl/slash", [])),
                          ("p1//n", ("p1/n", ["p1"])),
                          ("p1//p2/p3//n", ("p1/p2/p3/n",
                                            ["p1", "p1/p2/p3"])),
                          ("//n", ("/n", [""])),
                          ("n//", ("n/", ["n"]))]:
        eq_(au.get_subpaths(fname), expect)
예제 #3
0
def test_get_subpaths():
    for fname, expect in [
        (op.join("no", "dbl", "slash"), (op.join("no", "dbl", "slash"), [])),
        ("p1//n", (op.join("p1", "n"), ["p1"])),
        (op.join("p1//p2",
                 "p3//n"), (op.join("p1", "p2", "p3",
                                    "n"), ["p1",
                                           op.join("p1", "p2", "p3")])),
        (op.join("p1//p2", "p3//p4", "p5//",
                 "n"), (op.join("p1", "p2", "p3", "p4", "p5", "n"), [
                     "p1",
                     op.join("p1", "p2", "p3"),
                     op.join("p1", "p2", "p3", "p4", "p5")
                 ])), ("//n", (op.sep + "n", [""])),
        ("n//", ("n" + op.sep, ["n"]))
    ]:
        eq_(au.get_subpaths(fname), expect)