def test_process_object(self): test_object = FileObject() test_object.processed_analysis['file_type'] = {'mime': 'linux/device-tree'} test_object.file_path = str(TEST_FILE) result = self.analysis_plugin.process_object(test_object) assert result.processed_analysis[self.PLUGIN_NAME]['summary'] == ['device tree found']
def test_unpack_status_unpacked_file(self): test_fo_unpacked = FileObject(binary='aaaaa') test_fo_unpacked.file_path = '/dev/null' test_fo_unpacked.processed_analysis['unpacker'] = {} self.unpacker.get_unpack_status(test_fo_unpacked, []) result = test_fo_unpacked.processed_analysis['unpacker'] self.assertLess(result['entropy'], 0.7, 'entropy not valid') self.assertEqual(result['summary'], ['unpacked'])