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)
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)
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)
def test_exists_1(): assert fs.remove_file_silently(img.get_local_path()) assert img.exists() is False
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)