Exemplo n.º 1
0
 def test_with_rebased_files_returns_same_args_when_there_are_no_files(
         self):
     args = IDAPluginArguments()
     rebased_args = args.with_rebased_files(
         Directory(os.path.join(ROOT_DIR, 'inputs')),
         Directory(os.path.join(ROOT_DIR, 'outputs')))
     self.assertEqual(args, rebased_args)
Exemplo n.º 2
0
 def test_with_rebased_files_returns_correct_args_when_there_are_files(
         self):
     args = IDAPluginArguments(input_files=(StandaloneFile('file.exe'), ),
                               idb_file=StandaloneFile('file.idb'),
                               output_file=StandaloneFile('file.c'))
     rebased_args = args.with_rebased_files(
         Directory(os.path.join(ROOT_DIR, 'inputs')),
         Directory(os.path.join(ROOT_DIR, 'outputs')))
     self.assertEqual(len(rebased_args.input_files), 1)
     self.assertEqual(rebased_args.input_files[0].path,
                      os.path.join(ROOT_DIR, 'inputs', 'file.exe'))
     self.assertEqual(rebased_args.idb_file.path,
                      os.path.join(ROOT_DIR, 'inputs', 'file.idb'))
     self.assertEqual(rebased_args.output_file.path,
                      os.path.join(ROOT_DIR, 'outputs', 'file.c'))