Ejemplo n.º 1
0
 def scenario_invalid_settings_error_is_raised(self, test_settings,
                                               ref_exc_substr):
     with self.assertRaises(InvalidTestSettingsError) as cm:
         DecompilationArguments.from_test_settings(test_settings)
     self.assertIn(ref_exc_substr, str(cm.exception))
Ejemplo n.º 2
0
 def test_from_test_settings_args_is_present_when_set(self):
     test_settings = TestSettings(input='file.exe', args='--arg1 --arg2')
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.args, test_settings.args)
Ejemplo n.º 3
0
 def test_from_test_settings_output_file_has_correct_name_when_input_is_other_file(
         self):
     test_settings = TestSettings(input='file')
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.output_file.name, 'file.c')
Ejemplo n.º 4
0
 def test_from_test_settings_ar_index_is_present_when_set(self):
     test_settings = TestSettings(input='archive.a', ar_index=0)
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.ar_index, test_settings.ar_index)
Ejemplo n.º 5
0
 def test_from_test_settings_ar_name_is_present_when_set(self):
     test_settings = TestSettings(input='archive.a', ar_name='file.o')
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.ar_name, test_settings.ar_name)
Ejemplo n.º 6
0
 def test_from_test_settings_mode_is_present_when_set(self):
     test_settings = TestSettings(input='file.exe', mode='bin')
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.mode, test_settings.mode)
Ejemplo n.º 7
0
 def test_from_test_settings_hll_is_present_when_set(self):
     test_settings = TestSettings(input='file.exe', hll='py')
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.hll, test_settings.hll)
Ejemplo n.º 8
0
 def test_from_test_settings_format_is_present_when_set(self):
     test_settings = TestSettings(input='file.exe', format='elf')
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.format, test_settings.format)
Ejemplo n.º 9
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 = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.static_code_sigfile.name,
                      test_settings.static_code_sigfile)
Ejemplo n.º 10
0
 def test_from_test_settings_config_file_is_present_when_set(self):
     test_settings = TestSettings(input='test.exe', config='file.json')
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.config_file.name, test_settings.config)
Ejemplo n.º 11
0
 def test_from_test_settings_pdb_file_is_present_when_set(self):
     test_settings = TestSettings(input='test.exe', pdb='file.pdb')
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(args.pdb_file.name, test_settings.pdb)
Ejemplo n.º 12
0
 def test_from_test_settings_input_files_are_present_when_set(self):
     test_settings = TestSettings(input='file.exe')
     args = DecompilationArguments.from_test_settings(test_settings)
     self.assertEqual(len(args.input_files), 1)
     self.assertEqual(args.input_files[0].name, test_settings.input)