Tests turn things into inlineCallbacks.

This is to duplicate the old behavior of BaseTestCase and to generally
prevent the bad situation in that tests appear to be passing when in
fact they haven't run because @defer.inlineCallbacks was forgotten.
This commit is contained in:
andy
2010-09-08 22:43:54 +02:00
parent 33e86e2f73
commit 6a77fdbfac
3 changed files with 2 additions and 4 deletions

View File

@@ -250,7 +250,6 @@ def call(topic, msg):
msg_id = uuid.uuid4().hex
msg.update({'_msg_id': msg_id})
LOG.debug("MSG_ID is %s" % (msg_id))
conn = Connection.instance()
d = defer.Deferred()
consumer = DirectConsumer(connection=conn, msg_id=msg_id)

View File

@@ -52,7 +52,7 @@ class CloudTestCase(test.TrialTestCase):
self.compute_consumer = rpc.AdapterConsumer(connection=self.conn,
topic=FLAGS.compute_topic,
proxy=self.compute)
self.injected.append(self.compute_consumer.attach_to_twisted())
self.compute_consumer.attach_to_twisted()
try:
manager.AuthManager().create_user('admin', 'admin', 'admin')

View File

@@ -39,8 +39,7 @@ class RpcTestCase(test.TrialTestCase):
self.consumer = rpc.AdapterConsumer(connection=self.conn,
topic='test',
proxy=self.receiver)
self.injected.append(self.consumer.attach_to_twisted())
self.consumer.attach_to_twisted()
def test_call_succeed(self):
"""Get a value through rpc call"""