예제 #1
0
 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))
예제 #2
0
 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))
예제 #3
0
 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))
예제 #4
0
 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))
예제 #5
0
 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))
예제 #6
0
 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))
예제 #7
0
def test_path_split_with_base(path, base, expected):
    assert expected == path_split(path, base)
예제 #8
0
def test_path_split(path, expected):
    assert expected == path_split(path)