txghbot.test.test_core.WebhookDispatchingResourceTestCase(unittest.TestCase) class documentationtxghbot.test.test_core
(View In Hierarchy)
| Method | fakeVerifier | Undocumented |
| Method | setUp | Undocumented |
| Method | test__extractHeaderFailsWithMissingHeader | _extractHeader raises txghbot.InvalidData when the headers
do not contain the requested header. |
| Method | test__extractHeaderFailsWithNonASCIIValue | _extractHeader raises txghbot.InvalidData and logs the
decoding error when the requested header's first value is not ASCII. |
| Method | test__extractHeaderSucceedsWithFirstASCIIValue | _extractHeader returns a unicode/str
representing the first value for the requested header. |
| Method | test__deserializeContentFailsWithNonUTF8Payload | _deserializeContent raises txghbot.InvalidData and logs the
decoding error when attempting to decode a non-UTF8 encoded payload. |
| Method | test__deserializeContentFailsWithInvalidJSON | _deserializeContent raises txghbot.InvalidData and logs the
underlying deserialization exception when attempting to deserialize invalid
JSON. |
| Method | test__deserializeContentSucceedsWithUTF8_JSON | _deserializeContent successfully decodes and deserializes. UTF-8 encoded JSON. |
| Method | test__matchHookReturnsFalseOnException | _matchHook returns False if the IWebhook's match method
raises an Exception. |
| Method | test__matchHookReturnsHookResult | _matchHook returns whatever the IWebhook's match method
returns. |
| Method | test__processHookResultsFailsWithBadRequest | _processHookResults sets a status code of 400, logs the failure, and finishes the request if one or more of the hooks has failed. |
| Method | test__processHookResultsSucceedsWithOK | _processHookResults sets a status code of 200 and finishes the request if all hooks have run without raising an exception. |
| Method | test_render_POSTFailsWithPermissionDeniedOnInvalidHMAC | An invalid signature results in a 403 and no hooks running. |
| Method | test_render_POSTFailsWithBadRequestOnInvalidHeaders | If its headers lack the necessary metadata, the request fails with a 400 and no hooks are run. |
| Method | test_render_POSTFailsWithBadRequestOnInvalidContent | If its content cannot be decoded, the request fails with a 400 and no hooks are run. |
| Method | test_render_POSTDoesNotRunNonMatchingHooks | Webhooks that do not match the event aren't run. |
_extractHeader raises txghbot.InvalidData when the headers
do not contain the requested header.
_extractHeader raises txghbot.InvalidData and logs the
decoding error when the requested header's first value is not ASCII.
_extractHeader returns a unicode/str
representing the first value for the requested header.
_deserializeContent raises txghbot.InvalidData and logs the
decoding error when attempting to decode a non-UTF8 encoded payload.
_deserializeContent raises txghbot.InvalidData and logs the
underlying deserialization exception when attempting to deserialize invalid
JSON.
_deserializeContent successfully decodes and deserializes. UTF-8 encoded JSON.
_matchHook returns False if the IWebhook's match method
raises an Exception.
_matchHook returns whatever the IWebhook's match method
returns.
_processHookResults sets a status code of 400, logs the failure, and finishes the request if one or more of the hooks has failed.
_processHookResults sets a status code of 200 and finishes the request if all hooks have run without raising an exception.
An invalid signature results in a 403 and no hooks running.
If its headers lack the necessary metadata, the request fails with a 400 and no hooks are run.