def test_delete_file(self): new_file_name = generate_random_string() create_new_file(join(self.tempdir, new_file_name)) # When self.disk.delete_file(new_file_name) # Then self.assertEqual(get_number_of_files_in_dir(self.tempdir), 0)
def test_download_file(self): # Given new_file_name = generate_random_string() create_new_file(join(self.tempdir, new_file_name)) download_dir = create_random_dir() # When self.disk.download_file(new_file_name, download_dir) # Then self.assertEqual(get_number_of_files_in_dir(download_dir), 1) # Clean delete_dir(download_dir)
def __init__(self, base_dir, config_file_path): self._base_dir = base_dir self._config_file_path = config_file_path if not exists(self._config_file_path): create_new_file(self._config_file_path)