示例#1
0
 def test_get_oct_mode(self):
     assert fs.remove_file_silently(cfg.TMP_FILE)
     #
     assert fs.touch(cfg.TMP_FILE, mode=0755)
     assert fs.get_oct_mode(cfg.TMP_FILE) == '0755'
     #
     assert fs.remove_file_silently(cfg.TMP_FILE)
示例#2
0
 def test_get_oct_mode(self):
     assert fs.remove_file_silently(cfg.TMP_FILE)
     #
     assert fs.touch(cfg.TMP_FILE, mode=0755)
     assert fs.get_oct_mode(cfg.TMP_FILE) == '0755'
     #
     assert fs.remove_file_silently(cfg.TMP_FILE)
示例#3
0
 def test_set_mode_to(self):
     assert fs.remove_file_silently(cfg.TMP_FILE)
     #
     assert fs.touch(cfg.TMP_FILE, mode=0600)
     assert fs.get_oct_mode(cfg.TMP_FILE) == '0600'
     assert fs.set_mode_to(cfg.TMP_FILE, 0755)
     assert fs.set_mode_to(cfg.TMP_FILE, 0700)
     #
     assert fs.remove_file_silently(cfg.TMP_FILE)
示例#4
0
 def test_set_mode_to(self):
     assert fs.remove_file_silently(cfg.TMP_FILE)
     #
     assert fs.touch(cfg.TMP_FILE, mode=0600)
     assert fs.get_oct_mode(cfg.TMP_FILE) == '0600'
     assert fs.set_mode_to(cfg.TMP_FILE, 0755)
     assert fs.set_mode_to(cfg.TMP_FILE, 0700)
     #
     assert fs.remove_file_silently(cfg.TMP_FILE)
示例#5
0
 def test_touch(self):
     assert fs.remove_file_silently(cfg.TMP_FILE)
     #
     assert fs.touch(cfg.TMP_FILE)
     assert os.path.exists(cfg.TMP_FILE)
     #
     assert fs.remove_file_silently(cfg.TMP_FILE)
     assert fs.touch(cfg.TMP_FILE, mode=0644)
     assert fs.get_oct_mode(cfg.TMP_FILE) == '0644'
     #
     assert fs.remove_file_silently(cfg.TMP_FILE)
示例#6
0
 def test_touch(self):
     assert fs.remove_file_silently(cfg.TMP_FILE)
     #
     assert fs.touch(cfg.TMP_FILE)
     assert os.path.exists(cfg.TMP_FILE)
     #
     assert fs.remove_file_silently(cfg.TMP_FILE)
     assert fs.touch(cfg.TMP_FILE, mode=0644)
     assert fs.get_oct_mode(cfg.TMP_FILE) == '0644'
     #
     assert fs.remove_file_silently(cfg.TMP_FILE)
示例#7
0
def test_exists_1():
    assert fs.remove_file_silently(img.get_local_path())
    assert img.exists() is False
示例#8
0
 def test_remove_file_silently(self):
     fname = '/stupid_directory_name/doesnt_exist.txt'
     assert fs.remove_file_silently(fname)
     assert fs.touch(cfg.TMP_FILE)
     assert os.path.exists(cfg.TMP_FILE)
     assert fs.remove_file_silently(cfg.TMP_FILE)
示例#9
0
def test_exists_1():
    assert fs.remove_file_silently(img.get_local_path())
    assert img.exists() is False
示例#10
0
 def test_remove_file_silently(self):
     fname = '/stupid_directory_name/doesnt_exist.txt'
     assert fs.remove_file_silently(fname)
     assert fs.touch(cfg.TMP_FILE)
     assert os.path.exists(cfg.TMP_FILE)
     assert fs.remove_file_silently(cfg.TMP_FILE)