This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.1 docs or all OpenStack docs too.

The nova.tests.test_rpc Module

Unit Tests for remote procedure calls using queue

class nova.tests.test_rpc.RpcTestCase(methodName='runTest')

Bases: nova.test.TestCase

Test cases for rpc

setUp()
test_call_exception()

Test that exception gets passed back properly

rpc.call returns a RemoteError object. The value of the exception is converted to a string, so we convert it back to an int in the test.

test_call_succeed()

Get a value through rpc call

test_context_passed()

Makes sure a context is passed through rpc call

test_nested_calls()

Test that we can do an rpc.call inside another call

class nova.tests.test_rpc.TestReceiver

Bases: object

Simple Proxy class so the consumer has methods to call

Uses static methods because we aren’t actually storing any state

static context(context, value)

Returns dictionary version of context

static echo(context, value)

Simply returns whatever value is sent in

static fail(context, value)

Raises an exception with the value sent in