def testDescription(self): """Tests the description of the Deferred objects from the semaphore.""" d = [self.queue.acquire(i * 2) for i in range(5)] self.assertEqual( '*DeferredPrioritySemaphore(@%x, #1/5, priority=0, waiting=2)' % id(d[0]), base.describeDeferred(d[0]).partition(' ')[2]) # split off the active time self.assertEqual( 'DeferredPrioritySemaphore(@%x, #5/5, priority=8, waiting=2)' % id(d[4]), base.describeDeferred(d[4]).partition(' ')[2]) # split off the active time
def describeDeferred(self): """Describes this Deferred.""" generatorName = self._generator.__name__ if self._className is not None: generatorName = self._className + '.' + generatorName if self._reprFn: return '%s (%s):%s -> %s' % (generatorName, self._reprFn(), self._state, base.describeDeferred(self._current)) else: return '%s:%s -> %s' % (generatorName, self._state, base.describeDeferred(self._current))
def testDescription(self): """Tests the description of the Deferred objects from the semaphore.""" d = [self.queue.acquire(i * 2) for i in range(5)] self.assertEqual( '*DeferredPrioritySemaphore(@%x, #1/5, priority=0, waiting=2)' % id(d[0]), base.describeDeferred( d[0]).partition(' ')[2]) # split off the active time self.assertEqual( 'DeferredPrioritySemaphore(@%x, #5/5, priority=8, waiting=2)' % id(d[4]), base.describeDeferred( d[4]).partition(' ')[2]) # split off the active time
def describeDeferred(self): """Describes this Deferred.""" return '%s:%s -> %s' % (self._generator.__name__, self._state, base.describeDeferred(self._current))
def describeDeferred(self): """Describes this Deferred.""" return "%s:%s -> %s" % (self._generator.__name__, self._state, base.describeDeferred(self._current))