Beispiel #1
0
 def test_check_pass(self):
     # prepare
     import subprocess
     topdir = "sandbox/trash-dir"
     mkdirs(topdir)
     assert subprocess.call(["chmod", "+t", topdir]) == 0
     volume = volume_of("/mnt/disk")
     instance = Method1VolumeTrashDirectory(os.path.join(topdir,"123"), volume)
     
     instance.check() # should pass
Beispiel #2
0
 def test_check_when_is_symlink(self):
     # prepare
     import subprocess
     topdir = "sandbox/trash-dir"
     mkdirs(topdir)
     assert subprocess.call(["chmod", "+t", topdir]) == 0
     
     topdir_link = "sandbox/trash-dir-link"
     os.symlink('./trash-dir', topdir_link)
     volume = volume_of("/mnt/disk")
     instance = Method1VolumeTrashDirectory(os.path.join(topdir_link,"123"), volume)
     
     instance.check()
Beispiel #3
0
    def test_mkdirs_with_default_mode(self):

        mkdirs("sandbox/test-dir/sub-dir")

        assert os.path.isdir("sandbox/test-dir/sub-dir")
Beispiel #4
0
 def test_dir_sticky(self):
     mkdirs('sandbox/dir'); set_sticky_bit('sandbox/dir')
     assert is_sticky_dir('sandbox/dir')
Beispiel #5
0
 def test_dir_non_sticky(self):
     mkdirs('sandbox/dir'); assert not is_sticky_dir('sandbox/dir')
Beispiel #6
0
 def test_dir_sticky(self):
     mkdirs('sandbox/dir')
     set_sticky_bit('sandbox/dir')
     assert is_sticky_dir('sandbox/dir')
Beispiel #7
0
 def test_dir_non_sticky(self):
     mkdirs('sandbox/dir')
     assert not is_sticky_dir('sandbox/dir')
Beispiel #8
0
    def test_mkdirs_with_default_mode(self):

        mkdirs("sandbox/test-dir/sub-dir")

        assert os.path.isdir("sandbox/test-dir/sub-dir")