txacme.test.test_client module¶
-
class
txacme.test.test_client.
ClientTests
(*args, **kwargs)[source]¶ Client
provides a client interface for the ACME API.-
test_answer_challenge
()[source]¶ answer_challenge
responds to a challenge and returns the updated challenge.
-
test_answer_challenge_function
()[source]¶ The challenge is found in the responder after invoking
answer_challenge
.
_parse_authorization
raisesClientError
if the"next"
link is missing.
_check_authorization
raisesUnexpectedUpdate
if the return identifier doesn’t match.
-
test_challenge_missing_link
()[source]¶ _parse_challenge
raisesClientError
if the"up"
link is missing.
-
test_challenge_unexpected_uri
()[source]¶ _check_challenge
raisesUnexpectedUpdate
if the challenge does not have the expected URI.
-
test_default_client
()[source]¶ ~txacme.client._default_client
constructs a client if one was not provided.
-
test_directory_url_type
()[source]¶ from_url
expects atwisted.python.url.URL
instance for theurl
argument.
-
test_expect_response_wrong_code
()[source]¶ _expect_response
raisesClientError
if the response code does not match the expected code.
-
test_fetch_chain_empty
()[source]¶ If a certificate has no issuer link,
Client.fetch_chain
returns an empty chain.
-
test_fetch_chain_okay
()[source]¶ A certificate chain that is shorter than the max length is returned.
-
test_fetch_chain_too_long
()[source]¶ A certificate chain that is too long fails with
ClientError
.
-
test_fqdn_identifier
()[source]¶ fqdn_identifier
constructs anIdentifier
of the right type.
-
test_from_directory
()[source]¶ from_url()
constructs a client with a directory retrieved from the given URL.
-
test_no_tls_sni_01
()[source]¶ If no tls-sni-01 challenges are available,
NoSupportedChallenges
is raised.
-
test_poll
()[source]¶ poll
retrieves the latest state of an authorization resource, as well as the minimum time to wait before polling the state again.
-
test_poll_invalid
()[source]¶ If the authorization enters an invalid state while polling,
poll_until_valid
will fail withAuthorizationFailed
.
-
test_poll_timeout
()[source]¶ If the timeout is exceeded during polling,
poll_until_valid
will fail withCancelledError
.
-
test_poll_valid
()[source]¶ If the authorization enters a valid state while polling,
poll_until_valid
will fire with the updated authorization.
-
test_register_bad_nonce_once
()[source]¶ If a badNonce error is received, we clear all old nonces and retry the request once.
-
test_register_bad_nonce_twice
()[source]¶ If a badNonce error is received on a retry, fail the request.
-
test_register_error
()[source]¶ If some other error occurs during registration, a
txacme.client.ServerError
results.
-
test_register_existing
()[source]¶ If registration fails due to our key already being registered, the existing registration is returned.
-
test_register_existing_update
()[source]¶ If registration fails due to our key already being registered, the existing registration is updated.
-
test_register_missing_next
()[source]¶ If the directory does not return a
"next"
link, aClientError
failure occurs.
-
test_request_challenges
()[source]¶ request_challenges()
creates a new authorization, and returns the authorization resource with a list of possible challenges to proceed with.
-
test_tls_sni_01_no_singleton
()[source]¶ If a suitable singleton challenge is not found,
NoSupportedChallenges
is raised.
-
test_unexpected_update
()[source]¶ If the server does not return the registration we expected, an
UnexpectedUpdate
failure occurs.
-
-
class
txacme.test.test_client.
ExtraCoverageTests
(*args, **kwargs)[source]¶ Tests to get coverage on some test helpers that we don’t really want to maintain ourselves.