Ejemplo n.º 1
0
 def setUp(self):
     self.file = x.ExeFile(full_path(self.path))
Ejemplo n.º 2
0
 def test_no_pe_signature(self):
     with self.assertRaises(x.BrokenFileError) as exc:
         x.ExeFile(full_path('examples/NoPESignature.exe'))
     self.assertIn('Broken File. No "PE\\0\\0" in begin of PEHeader',
                   str(exc.exception))
Ejemplo n.º 3
0
 def test_wrong_file_format(self):
     with self.assertRaises(x.BrokenFileError) as excInfo:
         x.ExeFile(full_path('index.py'))
     self.assertIn('Broken file. No "MZ" in begin', str(excInfo.exception))
Ejemplo n.º 4
0
 def test_no_mz_signature(self):
     with self.assertRaises(x.BrokenFileError) as exc:
         x.ExeFile(full_path('examples/NoMZSignature.exe'))
     self.assertIn('Broken file. No "MZ" in begin', str(exc.exception))
Ejemplo n.º 5
0
 def test_file_not_found(self):
     self.assertRaises(FileNotFoundError, lambda: x.ExeFile(
         full_path('WrongPath/nofile.exe')))