Exemplo n.º 1
0
def test_get_hid(input_data, expected_output):
    test_fw = Firmware(binary=b'foo')
    test_fw.set_device_name('test_device')
    test_fw.set_vendor('foo')
    test_fw.set_firmware_version('1.0')
    test_fw.set_part_name(input_data)
    assert test_fw.get_hid() == expected_output
Exemplo n.º 2
0
def test_get_hid(input_data, expected_output):
    test_fw = Firmware(binary=b'foo')
    test_fw.device_name = 'test_device'
    test_fw.vendor = 'foo'
    test_fw.version = '1.0'
    test_fw.set_part_name(input_data)
    assert test_fw.get_hid() == expected_output
Exemplo n.º 3
0
 def _init_current_analysis(fw_object: Firmware):
     return {
         'files_to_unpack': list(fw_object.files_included),
         'files_to_analyze': [fw_object.uid],
         'start_time': time(),
         'unpacked_files_count': 1,
         'analyzed_files_count': 0,
         'total_files_count': 1 + len(fw_object.files_included),
         'hid': fw_object.get_hid(),
     }
Exemplo n.º 4
0
 def test_get_hid(self):
     test_fw = Firmware(binary=b'foo')
     test_fw.set_device_name('test_device')
     test_fw.set_vendor('foo')
     test_fw.set_firmware_version('1.0')
     self.assertEqual(test_fw.get_hid(), 'foo test_device - 1.0', 'hid not correct')
Exemplo n.º 5
0
def test_get_hid():
    test_fw = Firmware(binary=b'foo')
    test_fw.set_device_name('test_device')
    test_fw.set_vendor('foo')
    test_fw.set_firmware_version('1.0')
    assert test_fw.get_hid() == 'foo test_device - 1.0'