blob: a6eddd32e008f198af767712cc464b2c09c88e42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Eprouve quelques mécanismes de construction côté Python.
from chrysacase import ChrysalideTestCase
from pychrysalide.analysis.contents import FileContent
from pychrysalide.format.elf import ElfFormat
class TestNonExistingBinary(ChrysalideTestCase):
"""TestCase for non existent binary loading."""
def testNonExistent(self):
"""Try to load a non existent binary without crashing."""
cnt = FileContent('non_existing_binary')
self.assertIsNone(cnt)
with self.assertRaisesRegex(TypeError, 'The argument must be an instance of BinContent.'):
fmt = ElfFormat(cnt, None, None)
|