Example #1
0
 def testGetObjectsWithMultipleChildes(self):
     others = [
         MtpObject(self.default_data, self.get_default_info()),
         MtpObject(self.default_data, self.get_default_info()),
         MtpObject(self.default_data, self.get_default_info())
     ]
     uut = MtpObject(self.default_data, self.get_default_info())
     for obj in others:
         uut.add_object(obj)
     objs = uut.get_objects()
     self.assertEqual(len(objs), len(set(objs)))
     self.assertEqual(len(objs), len(others))
     self.assertEqual(set(objs), set(others))
Example #2
0
 def testGetObjectsWithMultipleChildes(self):
     others = [
         MtpObject(self.default_data, self.get_default_info()),
         MtpObject(self.default_data, self.get_default_info()),
         MtpObject(self.default_data, self.get_default_info())
     ]
     uut = MtpObject(self.default_data, self.get_default_info())
     for obj in others:
         uut.add_object(obj)
     objs = uut.get_objects()
     self.assertEqual(len(objs), len(set(objs)))
     self.assertEqual(len(objs), len(others))
     self.assertEqual(set(objs), set(others))
Example #3
0
 def testGetObjectsMultipleLevels(self):
     others = [
         MtpObject(self.default_data, self.get_default_info()),
         MtpObject(self.default_data, self.get_default_info()),
         MtpObject(self.default_data, self.get_default_info())
     ]
     uut = MtpObject(self.default_data, self.get_default_info())
     cur = uut
     for obj in others:
         cur.add_object(obj)
         cur = obj
     objs = uut.get_objects()
     self.assertEqual(len(objs), len(set(objs)))
     self.assertEqual(len(objs), len(others))
     self.assertEqual(set(objs), set(others))
Example #4
0
 def testGetObjectsMultipleLevels(self):
     others = [
         MtpObject(self.default_data, self.get_default_info()),
         MtpObject(self.default_data, self.get_default_info()),
         MtpObject(self.default_data, self.get_default_info())
     ]
     uut = MtpObject(self.default_data, self.get_default_info())
     cur = uut
     for obj in others:
         cur.add_object(obj)
         cur = obj
     objs = uut.get_objects()
     self.assertEqual(len(objs), len(set(objs)))
     self.assertEqual(len(objs), len(others))
     self.assertEqual(set(objs), set(others))
Example #5
0
 def testGetObjectsEmpty(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     self.assertEqual(uut.get_objects(), [])
Example #6
0
 def testGetObjectsEmpty(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     self.assertEqual(uut.get_objects(), [])