Exemplo n.º 1
0
 def testGetPropertyExceptionIfNotExist(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     with self.assertRaises(MtpProtocolException) as cm:
         uut.get_property(MtpObjectPropertyCode.StorageID - 1)
     self.assertEqual(cm.exception.response,
                      ResponseCodes.OBJECT_PROP_NOT_SUPPORTED)
Exemplo n.º 2
0
 def testGetPropertyExceptionIfNotExist(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     with self.assertRaises(MtpProtocolException) as cm:
         uut.get_property(MtpObjectPropertyCode.StorageID - 1)
     self.assertEqual(cm.exception.response, ResponseCodes.OBJECT_PROP_NOT_SUPPORTED)
Exemplo n.º 3
0
 def testGetPropertyDefaults(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     prop = uut.get_property(MtpObjectPropertyCode.ObjectFormat)
     self.assertIsNotNone(prop)
     self.assertEqual(prop.value.value, self.default_format)
Exemplo n.º 4
0
 def testGetPropertyDefaults(self):
     uut = MtpObject(self.default_data, self.get_default_info())
     prop = uut.get_property(MtpObjectPropertyCode.ObjectFormat)
     self.assertIsNotNone(prop)
     self.assertEqual(prop.value.value, self.default_format)