Commit 8b3ea0ae by Craig Heffner

Merged sundhaug92's tests

parent 9c77840c
:0B00000048656C6C6F20576F726C64D9
:00000001FF
S3100000000048656C6C6F20576F726C64D3
S5030001FB
from os.path import dirname
import binwalk
from nose.tools import eq_, ok_
def test_hello_world_simple_scan():
'''
Test: Open hello-world.ihex, scan for signatures
verify that only one signature is returned
verify that the only signature returned is Intel HEX data-signature
'''
scan_result = binwalk.scan(
dirname(__file__) + '/input-vectors/hello-world.ihex',
signature=True,
quiet=True,
extract=True) # Throws a warning for missing external extractor
# Test number of modules used
eq_(len(scan_result), 1)
# Test number of results for that module
eq_(len(scan_result[0].results), 1)
# Test result-description
eq_(scan_result[0].results[0].description,
'Intel HEX data, record type: data')
from os.path import dirname
import binwalk
from nose.tools import eq_, ok_
def test_hello_world_simple_scan():
'''
Test: Open hello-world.srec, scan for signatures
verify that only one signature is returned
verify that the only signature returned is Motorola S-rec data-signature
'''
scan_result = binwalk.scan(
dirname(__file__) + '/input-vectors/hello-world.srec',
signature=True,
quiet=True,
extract=True) # Throws a warning for missing external extractor
# Test number of modules used
eq_(len(scan_result), 1)
# Test number of results for that module
eq_(len(scan_result[0].results), 1)
# Test result-description
eq_(scan_result[0].results[0].description,
'Motorola S-Record; binary data in text format, record type: data (32-bit)')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment