Example #1
0
 def test_get_included_files_uids(self):
     test_parent = FileObject(binary=b'parent_file')
     test_child = FileObject(binary=b'1st child')
     test_child2 = FileObject(binary=b'2nd child')
     test_parent.add_included_file(test_child)
     test_parent.add_included_file(test_child2)
     self.assertEqual(len(test_parent.get_included_files_uids()), 2, 'number of uids not correct')
     self.assertIn(test_child.get_uid(), test_parent.get_included_files_uids(), 'uid of first file not found')
     self.assertIn(test_child2.get_uid(), test_parent.get_included_files_uids(), 'uid of second file not found')
Example #2
0
 def test_get_included_files_uids(self):
     test_parent = FileObject(binary=b'parent_file')
     test_child = FileObject(binary=b'1st child')
     test_child2 = FileObject(binary=b'2nd child')
     test_parent.add_included_file(test_child)
     test_parent.add_included_file(test_child2)
     assert len(test_parent.get_included_files_uids()
                ) == 2, 'number of uids not correct'
     assert test_child.uid in test_parent.get_included_files_uids(
     ), 'uid of first file not found'
     assert test_child2.uid in test_parent.get_included_files_uids(
     ), 'uid of second file not found'
Example #3
0
 def test_object_processing_one_child(self):
     root_object = FileObject(binary=b'root_file')
     child_object = FileObject(binary=b'first_child_object')
     root_object.add_included_file(child_object)
     self.base_plugin.in_queue.put(root_object)
     processed_object = self.base_plugin.out_queue.get()
     self.assertEqual(processed_object.uid, root_object.uid, 'uid changed')
     self.assertTrue(
         child_object.uid in root_object.get_included_files_uids(),
         'child object not in processed file')