def test_find_patches(self): """ Test for find_software_name_for_patch """ testdir = os.path.dirname(os.path.abspath(__file__)) ec_path = os.path.join(testdir, 'easyconfigs') init_config(build_options={ 'allow_modules_tool_mismatch': True, 'minimal_toolchains': True, 'use_existing_modules': True, 'external_modules_metadata': ConfigObj(), 'silent': True, 'valid_module_classes': module_classes(), 'validate': False, }) self.mock_stdout(True) ec = gh.find_software_name_for_patch('toy-0.0_fix-silly-typo-in-printf-statement.patch', [ec_path]) txt = self.get_stdout() self.mock_stdout(False) self.assertTrue(ec == 'toy') reg = re.compile(r'[1-9]+ of [1-9]+ easyconfigs checked') self.assertTrue(re.search(reg, txt))
def test_find_patches(self): """ Test for find_software_name_for_patch """ testdir = os.path.dirname(os.path.abspath(__file__)) ec_path = os.path.join(testdir, 'easyconfigs') init_config(build_options={ 'allow_modules_tool_mismatch': True, 'minimal_toolchains': True, 'use_existing_modules': True, 'external_modules_metadata': ConfigObj(), 'silent': True, 'valid_module_classes': module_classes(), 'validate': False, }) self.mock_stdout(True) ec = gh.find_software_name_for_patch('toy-0.0_fix-silly-typo-in-printf-statement.patch', [ec_path]) txt = self.get_stdout() self.mock_stdout(False) self.assertTrue(ec == 'toy') reg = re.compile(r'[1-9]+ of [1-9]+ easyconfigs checked') self.assertTrue(re.search(reg, txt))