def setUp(self): dir_name = os.path.join(os.getcwd(), 'tests', 'FOOBAR6_7') self.result_dir = os.path.join(dir_name + settings.results_postfix) dir_name = os.path.join(dir_name, 'dummy') if os.path.exists(self.result_dir): shutil.rmtree(self.result_dir) shutil.copytree(dir_name, self.result_dir) settings.autocomplete = False settings.data_dir = os.path.join(os.getcwd(), "data") self.target_tree = ComposeXML.run_compose(self.result_dir)
def setUp(self): dir_name = os.path.join(os.getcwd(), 'tests', 'FOOBAR6_7') self.result_dir = os.path.join(dir_name + settings.results_postfix) dir_name = os.path.join(dir_name, 'dummy') if os.path.exists(self.result_dir): shutil.rmtree(self.result_dir) shutil.copytree(dir_name, self.result_dir) settings.autocomplete = False settings.data_dir = os.path.join(os.getcwd(), "data") self.target_tree = ComposeXML.run_compose(self.result_dir)
def setUp(self): self.temp_dir = tempfile.mkdtemp(prefix='preupgrade', dir='/tmp') self.result_dir = os.path.join(self.temp_dir, 'FOOBAR6_7' + settings.results_postfix) dir_name = os.path.join(os.getcwd(), 'tests', 'FOOBAR6_7') shutil.copytree(dir_name, self.result_dir) self.autocomplete_orig = settings.autocomplete settings.autocomplete = False self.data_dir_orig = settings.data_dir settings.data_dir = os.path.join(os.getcwd(), "data") self.upgrade_path_orig = settings.UPGRADE_PATH self.target_tree = ComposeXML.run_compose(self.result_dir)
def setUp(self): self.temp_dir = tempfile.mkdtemp(prefix='preupgrade', dir='/tmp') self.result_dir = os.path.join(self.temp_dir, 'FOOBAR6_7' + settings.results_postfix) dir_name = os.path.join(os.getcwd(), 'tests', 'FOOBAR6_7') shutil.copytree(dir_name, self.result_dir) self.autocomplete_orig = settings.autocomplete settings.autocomplete = False self.data_dir_orig = settings.data_dir settings.data_dir = os.path.join(os.getcwd(), "data") self.upgrade_path_orig = settings.UPGRADE_PATH self.target_tree = ComposeXML.run_compose(self.result_dir)
def test_unicode_script_author(self): """Test processing of non-ascii characters for author section""" u_author = b'Petr Stod\xc5\xaflka'.decode(settings.defenc) script_file = os.path.join(self.result_dir, "unicode", "check") settings.autocomplete = True self.target_tree = None try: self.target_tree = ComposeXML.run_compose(self.result_dir) except UnicodeEncodeError: # TODO This has to be fixed for all supported Python versions like Python3.5,2.7 and 2.6 assert True self.assertTrue(self.target_tree) try: lines = FileHelper.get_file_content(script_file, "rb", True) except IOError: assert False author = [x for x in lines if u_author in x] self.assertTrue(author)
def test_unicode_script_author(self): """Test processing of non-ascii characters for author section""" u_author = b'Petr Stod\xc5\xaflka'.decode(settings.defenc) script_file = os.path.join(self.result_dir, "unicode", "check") settings.autocomplete = True self.target_tree = None try: self.target_tree = ComposeXML.run_compose(self.result_dir) except UnicodeEncodeError: # TODO This has to be fixed for all supported Python versions like Python3.5,2.7 and 2.6 assert True self.assertTrue(self.target_tree) try: lines = FileHelper.get_file_content(script_file, "rb", True) except IOError: assert False author = [x for x in lines if u_author in x] self.assertTrue(author)