def test_path_split(self): data = [ ('aa', ['aa']), ('aa/', ['aa']), ('aa/bB', ['aa', 'bB']), ('/aA/bB/c_c', ['/', 'aA', 'bB', 'c_c']), ('/aA/bB/c_c/', ['/', 'aA', 'bB', 'c_c']), ] for path, expected in data: self.assertEqual(expected, duviz.path_split(path))
def test_path_split(self): data = [ ("aa", ["aa"]), ("aa/", ["aa"]), ("aa/bB", ["aa", "bB"]), ("/aA/bB/c_c", ["/", "aA", "bB", "c_c"]), ("/aA/bB/c_c/", ["/", "aA", "bB", "c_c"]), ] for input, expected in data: self.assertEqual(expected, duviz.path_split(input))
def test_path_split_with_base(self): data = [ ('aa', 'a', ['aa']), ('aa/', '', ['aa']), ('a/b/c/d/', 'a', ['a', 'b', 'c', 'd']), ('a/b/c/d/', 'a/b', ['a/b', 'c', 'd']), ('a/b/c/d/', 'a/b/', ['a/b', 'c', 'd']), ('a/b/c/d/', 'a/b/c', ['a/b/c', 'd']), ('a/b/c/d/', 'a/b/c/d', ['a/b/c/d']), ('a/b/c/d', 'a/b/c/d/', ['a/b/c/d']), ('a/b/c/d', 'a/B', ['a', 'b', 'c', 'd']), ] for path, base, expected in data: self.assertEqual(expected, duviz.path_split(path, base))
def test_path_split_with_base(self): data = [ ("aa", "a", ["aa"]), ("aa/", "", ["aa"]), ("a/b/c/d/", "a", ["a", "b", "c", "d"]), ("a/b/c/d/", "a/b", ["a/b", "c", "d"]), ("a/b/c/d/", "a/b/", ["a/b", "c", "d"]), ("a/b/c/d/", "a/b/c", ["a/b/c", "d"]), ("a/b/c/d/", "a/b/c/d", ["a/b/c/d"]), ("a/b/c/d", "a/b/c/d/", ["a/b/c/d"]), ("a/b/c/d", "a/B", ["a", "b", "c", "d"]), ] for input, base, expected in data: self.assertEqual(expected, duviz.path_split(input, base))
def test_path_split_with_base(path, base, expected): assert expected == path_split(path, base)
def test_path_split(path, expected): assert expected == path_split(path)