def test_unicode_paths(tmppath): """Test creation of unicode paths.""" fs = XRootDFS(mkurl(tmppath)) d = u"\xe6\xf8\xe5" assert not fs.exists(d) assert fs.makedir(d) assert fs.exists(d) d = "\xc3\xb8\xc3\xa5\xc3\xa6" assert not fs.exists(d) assert fs.makedir(d) assert fs.exists(d)
def test_unicode_paths(tmppath): """Test creation of unicode paths.""" fs = XRootDFS(mkurl(tmppath)) d = u'\xe6\xf8\xe5' assert not fs.exists(d) assert fs.makedir(d) assert fs.exists(d) d = '\xc3\xb8\xc3\xa5\xc3\xa6' assert not fs.exists(d) assert fs.makedir(d) assert fs.exists(d)
def test_remove_dir(tmppath): """Test removedir.""" fs = XRootDFS(mkurl(tmppath)) # Remove non-empty directory pytest.raises(DirectoryNotEmptyError, fs.removedir, "data/bfolder/") # Use of recursive parameter pytest.raises(UnsupportedError, fs.removedir, "data/bfolder/", recursive=True) # Remove file pytest.raises(ResourceInvalidError, fs.removedir, "data/testa.txt") # Remove empty directory fs.makedir("data/tmp") assert fs.removedir("data/tmp") and not fs.exists("data/tmp") # Remove non-empty directory assert fs.removedir("data/bfolder/", force=True) assert fs.removedir("data/", force=True)