This Page

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

The nova.tests.api.openstack.test_common Module

Test suites for ‘common’ code used throughout the OpenStack HTTP API.

class nova.tests.api.openstack.test_common.LimiterTest(methodName='runTest')

Bases: nova.test.TestCase

Unit tests for the nova.api.openstack.common.limited method which takes in a list of items and, depending on the ‘offset’ and ‘limit’ GET params, returns a subset or complete set of the given items.

setUp()

Run before each test.

test_limiter_custom_max_limit()

Test a max_limit other than 1000.

test_limiter_limit_and_offset()

Test request with both limit and offset.

test_limiter_limit_medium()

Test limit of 10.

test_limiter_limit_over_max()

Test limit of 3000.

test_limiter_limit_zero()

Test limit of zero.

test_limiter_negative_limit()

Test a negative limit.

test_limiter_negative_offset()

Test a negative offset.

test_limiter_nothing()

Test request with no offset or limit

test_limiter_offset_bad()

Test offset key works with a BAD offset.

test_limiter_offset_blank()

Test offset key works with a blank offset.

test_limiter_offset_medium()

Test offset key works with a medium sized number.

test_limiter_offset_over_max()

Test offset key works with a number over 1000 (max_limit).

test_limiter_offset_zero()

Test offset key works with 0.

class nova.tests.api.openstack.test_common.MetadataXMLDeserializationTest(methodName='runTest')

Bases: nova.test.TestCase

test_create()
test_create_empty()
test_update()
test_update_all()
class nova.tests.api.openstack.test_common.MetadataXMLSerializationTest(methodName='runTest')

Bases: nova.test.TestCase

test_create()
test_delete()
test_index()
test_index_null()
test_index_unicode()
test_show()
test_update_all()
test_update_item()
class nova.tests.api.openstack.test_common.MiscFunctionsTest(methodName='runTest')

Bases: nova.test.TestCase

test_get_id_from_href_with_int()
test_get_id_from_href_with_int_url()
test_get_id_from_href_with_int_url_query()
test_get_id_from_href_with_uuid()
test_get_id_from_href_with_uuid_url()
test_get_id_from_href_with_uuid_url_query()
test_get_version_from_href()
test_get_version_from_href_2()
test_get_version_from_href_default()
test_remove_version_from_href()
test_remove_version_from_href_2()
test_remove_version_from_href_3()
test_remove_version_from_href_4()
test_remove_version_from_href_bad_request()
test_remove_version_from_href_bad_request_2()
test_remove_version_from_href_bad_request_3()
class nova.tests.api.openstack.test_common.PaginationParamsTest(methodName='runTest')

Bases: nova.test.TestCase

Unit tests for the nova.api.openstack.common.get_pagination_params method which takes in a request object and returns ‘marker’ and ‘limit’ GET params.

test_invalid_limit()

Test invalid limit param.

test_invalid_marker()

Test invalid marker param.

test_no_params()

Test no params.

test_valid_limit()

Test valid limit param.

test_valid_limit_and_marker()

Test valid limit and marker parameters.

test_valid_marker()

Test valid marker param.