def scenario_invalid_settings_error_is_raised(self, test_settings, ref_exc_substr): with self.assertRaises(InvalidTestSettingsError) as cm: R2PluginArguments.from_test_settings(test_settings) self.assertIn(ref_exc_substr, str(cm.exception))
def test_from_test_settings_args_is_present_when_set(self): test_settings = R2PluginTestSettings(input='test.exe', args='--arg1 --arg2') args = R2PluginArguments.from_test_settings(test_settings) self.assertEqual(args.args, test_settings.args)
def test_from_test_settings_output_file_has_correct_name_when_it_does_not_end_with_exe( self): test_settings = R2PluginTestSettings(input='test.elf') args = R2PluginArguments.from_test_settings(test_settings) self.assertEqual(args.output_file.name, 'test.elf.c')
def test_from_test_settings_output_file_is_automatically_set(self): test_settings = R2PluginTestSettings(input='test.exe') args = R2PluginArguments.from_test_settings(test_settings) self.assertIsNotNone(args.output_file)
def test_from_test_settings_project_is_present_when_set(self): test_settings = R2PluginTestSettings(input='test.exe', project='rc') args = R2PluginArguments.from_test_settings(test_settings) self.assertEqual(args.project_file.name, test_settings.project)
def test_from_test_settings_input_files_are_present_when_set(self): test_settings = R2PluginTestSettings(input='test.exe') args = R2PluginArguments.from_test_settings(test_settings) self.assertEqual(len(args.input_files), 1) self.assertEqual(args.input_files[0].name, test_settings.input)