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')
def testTransmissionRPCValueChange(self): for rpctype in rpctypes: rpcval = TransmissionRPCValue('TEST', value=None, type=rpctype['type'], mutable=True) rpcval.set(rpctype['value']) self.assertEqual(rpcval.mr, rpctype['value']) self.assertEqual(rpcval.hr, rpctype['pretty'])