Esempio n. 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
Esempio n. 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()
Esempio n. 3
0
    def test_mkdirs_with_default_mode(self):

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

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

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

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