예제 #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])
예제 #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])
예제 #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)
예제 #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)
예제 #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])
예제 #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])
예제 #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)
예제 #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)
예제 #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)
예제 #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)