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)
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)