def test_abspath_zip(): with pth.tmp() as tmp: pth.Path('tests/files/test.zip').copy(tmp) with tmp.cd: assert pth("test.zip").abs == tmp / "test.zip" assert pth("test.zip").abspath == tmp / "test.zip" assert (pth("test.zip") / "a.txt").abs == tmp / "test.zip" / "a.txt" assert (pth("test.zip") / "a.txt").abspath == tmp / "test.zip" / "a.txt"
def test_exists_zip(): with pth.tmp() as tmp: zp = pth.Path('tests/files/test.zip').copy(tmp) with tmp.cd: assert (pth("test.zip") / "a.txt").exists assert not (pth("test.zip") / "crappo").exists assert (pth(zp) / "a.txt").exists assert not (pth(zp) / "crappo").exists
def test_abspath(): with pth.tmp().cd as tmp: assert pth("path").abs == tmp / "path" assert pth("path").abspath == tmp / "path"