Пример #1
0
 def test_with_rebased_files_returns_same_args_when_there_are_no_files(self):
     args = DecompilerArguments()
     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)
Пример #2
0
 def test_with_rebased_files_returns_correct_args_when_there_are_files(self):
     args = DecompilerArguments(
         input_files=(StandaloneFile('file.exe'),),
         pdb_file=StandaloneFile('file.pdb'),
         config_file=StandaloneFile('file.json'),
         static_code_archive=StandaloneFile('file.a'),
         static_code_sigfile=StandaloneFile('file.sig'),
         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.pdb_file.path,
         os.path.join(ROOT_DIR, 'inputs', 'file.pdb')
     )
     self.assertEqual(
         rebased_args.config_file.path,
         os.path.join(ROOT_DIR, 'inputs', 'file.json')
     )
     self.assertEqual(
         rebased_args.static_code_archive.path,
         os.path.join(ROOT_DIR, 'inputs', 'file.a')
     )
     self.assertEqual(
         rebased_args.static_code_sigfile.path,
         os.path.join(ROOT_DIR, 'inputs', 'file.sig')
     )
     self.assertEqual(
         rebased_args.output_file.path,
         os.path.join(ROOT_DIR, 'outputs', 'file.c')
     )