예제 #1
0
 def test_forward_slash(self):
     assert list(tokenize_path("foo/bar")) == ["bar", "foo"]
예제 #2
0
 def test_relative_paths(self):
     assert list(tokenize_path('./')) == ['.']
     assert list(tokenize_path('./../')) == ['..', '.']
     assert list(tokenize_path('./foo/bar')) == ['bar', 'foo', '.']
     assert list(tokenize_path('.\\foo\\bar')) == ['bar', 'foo', '.']
예제 #3
0
 def test_path_with_spaces(self):
     assert list(tokenize_path('\\foo bar\\bar')) == ['bar', 'foo bar']
예제 #4
0
def test_tokenize_path():
    assert list(tokenize_path('foo/bar')) == ['bar', 'foo']
    assert list(tokenize_path('foo\\bar')) == ['bar', 'foo']
    assert list(tokenize_path('foo.bar')) == ['foo.bar']
    assert list(tokenize_path('/foo/bar')) == ['bar', 'foo']
예제 #5
0
 def test_additional_slash_in_front(self):
     assert list(tokenize_path('/foo/bar')) == ['bar', 'foo']
     assert list(tokenize_path('\\foo\\bar')) == ['bar', 'foo']
예제 #6
0
 def test_additional_slash_in_front(self):
     assert list(tokenize_path("/foo/bar")) == ["bar", "foo"]
     assert list(tokenize_path("\\foo\\bar")) == ["bar", "foo"]
예제 #7
0
 def test_path_with_spaces(self):
     assert list(tokenize_path("\\foo bar\\bar")) == ["bar", "foo bar"]
예제 #8
0
 def test_path_with_spaces(self):
     assert list(tokenize_path('\\foo bar\\bar')) == ['bar', 'foo bar']
예제 #9
0
 def test_no_path(self):
     assert list(tokenize_path('/')) == []
예제 #10
0
 def test_additional_slash_in_front(self):
     assert list(tokenize_path('/foo/bar')) == ['bar', 'foo']
     assert list(tokenize_path('\\foo\\bar')) == ['bar', 'foo']
예제 #11
0
 def test_relative_paths(self):
     assert list(tokenize_path('./')) == ['.']
     assert list(tokenize_path('./../')) == ['..', '.']
     assert list(tokenize_path('./foo/bar')) == ['bar', 'foo', '.']
     assert list(tokenize_path('.\\foo\\bar')) == ['bar', 'foo', '.']
예제 #12
0
 def test_dot_does_not_separate(self):
     assert list(tokenize_path('foo.bar')) == ['foo.bar']
예제 #13
0
 def test_back_slash(self):
     assert list(tokenize_path('foo\\bar')) == ['bar', 'foo']
예제 #14
0
 def test_forward_slash(self):
     assert list(tokenize_path('foo/bar')) == ['bar', 'foo']
예제 #15
0
 def test_back_slash(self):
     assert list(tokenize_path("foo\\bar")) == ["bar", "foo"]
예제 #16
0
 def test_forward_slash(self):
     assert list(tokenize_path('foo/bar')) == ['bar', 'foo']
예제 #17
0
 def test_dot_does_not_separate(self):
     assert list(tokenize_path("foo.bar")) == ["foo.bar"]
예제 #18
0
 def test_back_slash(self):
     assert list(tokenize_path('foo\\bar')) == ['bar', 'foo']
예제 #19
0
 def test_relative_paths(self):
     assert list(tokenize_path("./")) == ["."]
     assert list(tokenize_path("./../")) == ["..", "."]
     assert list(tokenize_path("./foo/bar")) == ["bar", "foo", "."]
     assert list(tokenize_path(".\\foo\\bar")) == ["bar", "foo", "."]
예제 #20
0
 def test_dot_does_not_separate(self):
     assert list(tokenize_path('foo.bar')) == ['foo.bar']
예제 #21
0
 def test_no_path(self):
     assert list(tokenize_path("/")) == []
예제 #22
0
def test_tokenize_path():
    assert list(tokenize_path('foo/bar')) == ['bar', 'foo']
    assert list(tokenize_path('foo\\bar')) == ['bar', 'foo']
    assert list(tokenize_path('foo.bar')) == ['foo.bar']