def test_main_with_no_arguments(self): pacsudoku = main() with open(self.default_config_file) as rawfile: actual_xml_content = rawfile.readlines() self.assertEqual([], actual_xml_content) pacsudoku.config_file_handler.file.close() remove(self.default_config_file)
def test_main_with_gui_argument(self): argv.append("-g") pacsudoku = main() with open(self.default_config_file) as rawfile: actual_xml_content = rawfile.readlines() self.assertEqual([], actual_xml_content) argv.pop() pacsudoku.config_file.file.close() remove(self.default_config_file)
def test_main_with_valid_config_file(self): argv.append("-c") argv.append(self.my_config_file) pacsudoku = main() with open(self.my_config_file) as rawfile: actual_xml_content = rawfile.readlines() self.assertEqual(self.expected_xml_content, actual_xml_content) argv.pop() argv.pop() pacsudoku.config_file_handler.file.close()