Esempio n. 1
0
 def testTransmissionRPCValueHooks(self):
     # TODO Test onwrite() / rename to onpush() / ...? -- Investigate!
     for rpctype in rpctypes:
         rpcval = TransmissionRPCValue('TEST', value=0, type=rpctype['type'], mutable=True)
         rpcval.onupdate(lambda val: None)
         rpcval.prettify(lambda val: u'Snow White')
         rpcval.update(rpctype['value'])
         self.assertEqual(rpcval.mr, None)
         self.assertEqual(rpcval.hr, u'Snow White')
Esempio n. 2
0
 def testTransmissionRPCValueUpdate(self):
     for rpctype in rpctypes:
         rpcval = TransmissionRPCValue('TEST', value=None, type=rpctype['type'], mutable=True)
         rpcval.update(rpctype['value'])
         self.assertEqual(rpcval.mr, rpctype['value'])
         self.assertEqual(rpcval.hr, rpctype['pretty'])