Ejemplo n.º 1
0
 def testGetObjectChildren(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)
     obj = uut.get_object(others[0].get_uid())
     self.assertEqual(obj, others[0])
Ejemplo n.º 2
0
 def testGetObjectChildren(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)
     obj = uut.get_object(others[0].get_uid())
     self.assertEqual(obj, others[0])
Ejemplo n.º 3
0
 def testGetObjectSelfWithChilds(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)
     obj = uut.get_object(uut.get_uid())
     self.assertEqual(uut, obj)
Ejemplo n.º 4
0
 def testGetObjectSelfWithChilds(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)
     obj = uut.get_object(uut.get_uid())
     self.assertEqual(uut, obj)
Ejemplo n.º 5
0
 def testGetObjectMultipleLevels(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
     obj = uut.get_object(others[-1].get_uid())
     self.assertEqual(obj, others[-1])
Ejemplo n.º 6
0
 def testGetObjectMultipleLevels(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
     obj = uut.get_object(others[-1].get_uid())
     self.assertEqual(obj, others[-1])
Ejemplo n.º 7
0
 def testGetObjectDoesntExist(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     obj = uut.get_object(uut.get_uid() + 1)
     self.assertIsNone(obj)
Ejemplo n.º 8
0
 def testGetObjectSelfAlone(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     obj = uut.get_object(uut.get_uid())
     self.assertEqual(uut, obj)
Ejemplo n.º 9
0
 def testGetObjectDoesntExist(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     obj = uut.get_object(uut.get_uid() + 1)
     self.assertIsNone(obj)
Ejemplo n.º 10
0
 def testGetObjectSelfAlone(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     obj = uut.get_object(uut.get_uid())
     self.assertEqual(uut, obj)