micropython-lib/os.path/test_path.py

23 wiersze
522 B
Python
Czysty Zwykły widok Historia

2014-05-14 18:16:46 +00:00
import sys
dir = "."
if "/" in __file__:
dir = __file__.rsplit("/", 1)[0]
sys.path[0] = dir + "/os"
2014-05-14 18:16:46 +00:00
from path import *
assert split("") == ("", "")
assert split("path") == ("", "path")
assert split("/") == ("/", "")
assert split("/foo") == ("/", "foo")
assert split("/foo/") == ("/foo", "")
assert split("/foo/bar") == ("/foo", "bar")
2014-05-14 18:16:13 +00:00
assert exists(dir + "/test_path.py")
assert not exists(dir + "/test_path.py--")
2014-05-14 18:16:13 +00:00
assert isdir(dir + "/os")
assert not isdir(dir + "/os--")
assert not isdir(dir + "/test_path.py")