def test_create_output_directory(self): """Should create a folder with the expected name.""" self.clean_test_output_folder = True shutil.rmtree(self.test_output_folder, ignore_errors=True) self.assertFalse(os.path.isdir(self.test_output_folder)) Images._create_output_directory(self.xlsform1) self.assertTrue(os.path.isdir(self.test_output_folder))
def test_create_output_directory_with_spaces(self): """Should create a folder with the expected name.""" self.clean_test_output_folder = True self.test_output_folder = 'folder with spaces' test_file_path = 'folder with spaces/dummy_file.txt' shutil.rmtree(self.test_output_folder, ignore_errors=True) self.assertFalse(os.path.isdir(self.test_output_folder)) Images._create_output_directory(test_file_path) self.assertTrue(os.path.isdir(self.test_output_folder))
def test_create_output_directory_with_spaces_unc(self): """Should create a folder with the expected name.""" self.clean_test_output_folder = True test_folder = os.path.join(self.cwd, 'folder with spaces') unc_path = '\\\\localhost\\c$' + test_folder[2:] self.test_output_folder = test_folder test_file_path = unc_path + '\\my_xlsform.xlsx' shutil.rmtree(self.test_output_folder, ignore_errors=True) self.assertFalse(os.path.isdir(self.test_output_folder)) Images._create_output_directory(test_file_path) self.assertTrue(os.path.isdir(self.test_output_folder))