keystonemiddleware.tests.unit.client_fixtures.
Examples
¶Bases: fixtures.fixture.Fixture
Example tokens and certs loaded from the examples directory.
To use this class correctly, the module needs to override the test suite class to use testresources.OptimisingTestSuite (otherwise the files will be read on every test). This is done by defining a load_tests function in the module, like this:
(see http://docs.python.org/2/library/unittest.html#load-tests-protocol )
setUp
()¶Prepare the Fixture for use.
This should not be overridden. Concrete fixtures should implement _setUp. Overriding of setUp is still supported, just not recommended.
After setUp has completed, the fixture will have one or more attributes which can be used (these depend totally on the concrete subclass).
Raises: | MultipleExceptions if _setUp fails. The last exception captured within the MultipleExceptions will be a SetupError exception. |
---|---|
Returns: | None. |
Changed in 1.3: | The recommendation to override setUp has been reversed - before 1.3, setUp() should be overridden, now it should not be. |
Changed in 1.3.1: | |
BaseException is now caught, and only subclasses of Exception are wrapped in MultipleExceptions. |
keystonemiddleware.tests.unit.test_ec2_token_middleware.
EC2TokenMiddlewareTestBad
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.test_ec2_token_middleware.EC2TokenMiddlewareTestBase
test_communication_failure
(mock_request)¶test_no_key_id
()¶test_no_result_data
(mock_request)¶test_no_signature
()¶keystonemiddleware.tests.unit.test_ec2_token_middleware.
EC2TokenMiddlewareTestBase
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.utils.TestCase
TEST_HOST
= 'fakehost'¶TEST_PORT
= 35357¶TEST_PROTOCOL
= 'https'¶TEST_URL
= 'https://fakehost:35357/v2.0/ec2tokens'¶setUp
()¶Hook method for setting up the test fixture before exercising it.
keystonemiddleware.tests.unit.test_ec2_token_middleware.
EC2TokenMiddlewareTestGood
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.test_ec2_token_middleware.EC2TokenMiddlewareTestBase
test_protocol_old_versions
(mock_request)¶test_protocol_v4
(mock_request)¶keystonemiddleware.tests.unit.test_ec2_token_middleware.
FakeApp
¶Bases: object
This represents a WSGI app protected by the auth_token middleware.
keystonemiddleware.tests.unit.test_entry_points.
TestPasteDeploymentEntryPoints
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.utils.BaseTestCase
test_entry_points
()¶keystonemiddleware.tests.unit.test_fixtures.
AuthTokenFixtureTest
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.auth_token.test_auth_token_middleware.BaseAuthTokenMiddlewareTest
setUp
()¶Hook method for setting up the test fixture before exercising it.
test_auth_token_fixture_expired_token
()¶test_auth_token_fixture_invalid_token
()¶test_auth_token_fixture_valid_token
()¶keystonemiddleware.tests.unit.test_opts.
OptsTestCase
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.utils.TestCase
test_entry_point
()¶test_list_auth_token_opts
()¶test_original_list_all_options
()¶keystonemiddleware.tests.unit.test_s3_token_middleware.
FakeApp
¶Bases: object
This represents a WSGI app protected by the auth_token middleware.
keystonemiddleware.tests.unit.test_s3_token_middleware.
S3TokenMiddlewareTestBad
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.test_s3_token_middleware.S3TokenMiddlewareTestBase
setUp
()¶Hook method for setting up the test fixture before exercising it.
test_bad_reply
()¶test_fail_to_connect_to_keystone
()¶keystonemiddleware.tests.unit.test_s3_token_middleware.
S3TokenMiddlewareTestBase
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.utils.TestCase
TEST_URL
= 'https://fakehost/identity/v2.0/s3tokens'¶TEST_WWW_AUTHENTICATE_URI
= 'https://fakehost/identity'¶setUp
()¶Hook method for setting up the test fixture before exercising it.
start_fake_response
(status, headers)¶keystonemiddleware.tests.unit.test_s3_token_middleware.
S3TokenMiddlewareTestDeprecatedOptions
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.test_s3_token_middleware.S3TokenMiddlewareTestBase
setUp
()¶Hook method for setting up the test fixture before exercising it.
test_logs_warning
()¶keystonemiddleware.tests.unit.test_s3_token_middleware.
S3TokenMiddlewareTestGood
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.test_s3_token_middleware.S3TokenMiddlewareTestBase
setUp
()¶Hook method for setting up the test fixture before exercising it.
test_insecure
(MOCK_REQUEST)¶test_insecure_option
()¶test_no_path_request
()¶test_unicode_path
()¶test_without_auth_storage_token
()¶keystonemiddleware.tests.unit.utils.
BaseTestCase
(*args, **kwds)¶Bases: oslotest.base.BaseTestCase
setUp
()¶Hook method for setting up the test fixture before exercising it.
keystonemiddleware.tests.unit.utils.
DisableModuleFixture
(module, *args, **kw)¶Bases: fixtures.fixture.Fixture
A fixture to provide support for unloading/disabling modules.
clear_module
()¶setUp
()¶Ensure ImportError for the specified module.
tearDown
()¶keystonemiddleware.tests.unit.utils.
MiddlewareTestCase
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.utils.BaseTestCase
create_app
(*args, **kwargs)¶create_middleware
(cb, **kwargs)¶create_simple_app
(*args, **kwargs)¶create_simple_middleware
(status='200 OK', body='', headers=None, **kwargs)¶keystonemiddleware.tests.unit.utils.
NoModuleFinder
(module)¶Bases: object
Disallow further imports of ‘module’.
find_module
(fullname, path)¶keystonemiddleware.tests.unit.utils.
TestCase
(*args, **kwds)¶Bases: keystonemiddleware.tests.unit.utils.BaseTestCase
TEST_DOMAIN_ID
= '1'¶TEST_DOMAIN_NAME
= 'aDomain'¶TEST_GROUP_ID
= '3d630c6426004d6c939fc3cbe5393432'¶TEST_ROLE_ID
= '8fd07146bb4f4d369961378f0d8f9e1a'¶TEST_ROOT_URL
= 'http://127.0.0.1:5000/'¶TEST_TENANT_ID
= '1'¶TEST_TENANT_NAME
= 'aTenant'¶TEST_TOKEN
= 'aToken'¶TEST_TRUST_ID
= 'aTrust'¶TEST_USER
= 'test'¶TEST_USER_ID
= '23b5c1d1628044c39a9053b4762b1248'¶setUp
()¶Hook method for setting up the test fixture before exercising it.
tearDown
()¶Hook method for deconstructing the test fixture after testing it.
keystonemiddleware.tests.unit.utils.
TestResponse
(data)¶Bases: requests.models.Response
Utility class to wrap requests.Response.
Class used to wrap requests.Response and provide some convenience to initialize with a dict.
text
¶Content of the response, in unicode.
If Response.encoding is None, encoding will be guessed using
chardet
.
The encoding of the response content is determined based solely on HTTP
headers, following RFC 2616 to the letter. If you can take advantage of
non-HTTP knowledge to make a better guess at the encoding, you should
set r.encoding
appropriately before accessing this property.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.