コード例 #1
0
 def test_from_test_settings_output_file_has_correct_name_when_input_is_other_file(self):
     test_settings = TestSettings(input='file')
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(args.output_file.name, 'file.c')
コード例 #2
0
 def scenario_invalid_settings_error_is_raised(self, test_settings, ref_exc_substr):
     with self.assertRaises(InvalidTestSettingsError) as cm:
         DecompilerArguments.from_test_settings(test_settings)
     self.assertIn(ref_exc_substr, str(cm.exception))
コード例 #3
0
 def test_from_test_settings_ar_name_is_present_when_set(self):
     test_settings = TestSettings(input='archive.a', ar_name='file.o')
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(args.ar_name, test_settings.ar_name)
コード例 #4
0
 def test_from_test_settings_args_is_present_when_set(self):
     test_settings = TestSettings(input='file.exe', args='--arg1 --arg2')
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(args.args, test_settings.args)
コード例 #5
0
 def test_from_test_settings_hll_is_present_when_set(self):
     test_settings = TestSettings(input='file.exe', hll='py')
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(args.hll, test_settings.hll)
コード例 #6
0
 def test_from_test_settings_ar_index_is_present_when_set(self):
     test_settings = TestSettings(input='archive.a', ar_index=0)
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(args.ar_index, test_settings.ar_index)
コード例 #7
0
 def test_from_test_settings_mode_is_present_when_set(self):
     test_settings = TestSettings(input='file.exe', mode='bin')
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(args.mode, test_settings.mode)
コード例 #8
0
 def test_from_test_settings_static_code_sigfile_is_present_when_set(self):
     test_settings = TestSettings(input='test.exe', static_code_sigfile='file.sig')
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(args.static_code_sigfile.name, test_settings.static_code_sigfile)
コード例 #9
0
 def test_from_test_settings_config_file_is_present_when_set(self):
     test_settings = TestSettings(input='test.exe', config='file.json')
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(args.config_file.name, test_settings.config)
コード例 #10
0
 def test_from_test_settings_pdb_file_is_present_when_set(self):
     test_settings = TestSettings(input='test.exe', pdb='file.pdb')
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(args.pdb_file.name, test_settings.pdb)
コード例 #11
0
 def test_from_test_settings_input_files_are_present_when_set(self):
     test_settings = TestSettings(input='file.exe')
     args = DecompilerArguments.from_test_settings(test_settings)
     self.assertEqual(len(args.input_files), 1)
     self.assertEqual(args.input_files[0].name, test_settings.input)