os.path: test_path.py: Use paths relative to module dir.

Allows to run via test aggregators.
pull/216/head
Paul Sokolovsky 2017-10-18 14:03:05 +03:00
rodzic e9b54606e9
commit 61f9dd8721
1 zmienionych plików z 11 dodań i 6 usunięć

Wyświetl plik

@ -1,5 +1,10 @@
import sys
sys.path[0] = "os"
dir = "."
if "/" in __file__:
dir = __file__.rsplit("/", 1)[0]
sys.path[0] = dir + "/os"
from path import *
assert split("") == ("", "")
@ -9,9 +14,9 @@ assert split("/foo") == ("/", "foo")
assert split("/foo/") == ("/foo", "")
assert split("/foo/bar") == ("/foo", "bar")
assert exists("test_path.py")
assert not exists("test_path.py--")
assert exists(dir + "/test_path.py")
assert not exists(dir + "/test_path.py--")
assert isdir("os")
assert not isdir("os--")
assert not isdir("test_path.py")
assert isdir(dir + "/os")
assert not isdir(dir + "/os--")
assert not isdir(dir + "/test_path.py")