def testInvalidSync(self): s = ~eSync.SYNCHRONOUS assert not eSync.isValid(s) api = iApiAction(self.ipc, "hello.world", self.solicited) try: api.sync = s except ApiParamError, e: assert e.item == s assert eSync in e.allowedTypes assert len(e.allowedTypes) == 1
def setSync(self, sync=eSync.SYNCHRONOUS): if not eSync.isValid(sync): raise ApiParamError(sync, eSync) self._sync = sync