util.test package

Submodules

util.test.test_aws module

class util.test.test_aws.TestAws(methodName='runTest')

Bases: django.test.testcases.TestCase

setUp()
test_instantiate_credentials_from_config()

Tests instantiating AWS Credentials from a valid configuration.

test_instantiate_credentials_from_config_empty_access_key()

Tests instantiating AWS Credentials from a configuration with an empty access key.

test_instantiate_credentials_from_config_empty_secret_key()

Tests instantiating AWS Credentials from a configuration with an empty secret key.

test_instantiate_credentials_from_config_missing_access_key()

Tests instantiating AWS Credentials from a configuration missing access key.

test_instantiate_credentials_from_config_missing_secret_key()

Tests instantiating AWS Credentials from a configuration missing secret key.

class util.test.test_aws.TestS3Client(methodName='runTest')

Bases: django.test.testcases.TestCase

setUp()
test_list_objects_bucket_not_found(*args, **keywargs)
test_list_objects_empty_bucket(*args, **keywargs)
test_list_objects_invalid_bucket_name()
test_list_objects_iteration(*args, **keywargs)
test_list_objects_prefix(*args, **keywargs)
test_list_objects_prefix_recursive(*args, **keywargs)
class util.test.test_aws.TestSQSClient(methodName='runTest')

Bases: django.test.testcases.TestCase

setUp()
test_receive_messages_10(*args, **keywargs)
test_receive_messages_15(*args, **keywargs)
test_receive_messages_1_batch_size_1(*args, **keywargs)
test_receive_messages_1_batch_size_100(*args, **keywargs)
test_send_messages(*args, **keywargs)

util.test.test_broker module

class util.test.test_broker.TestBroker(methodName='runTest')

Bases: django.test.testcases.TestCase

setUp()
test_bad_credentials_broker_url()

Tests instantiating broker from invalid URL with credential delimiter.

test_missing_solidus_credentials_broker_url()

Tests instantiating broker from invalid URL missing double solidus delimiter.

test_valid_rabbitmq_broker_url()

Tests instantiating broker from URL for RabbitMQ.

test_valid_sqs_broker_url()

Tests instantiating broker from URL for SQS with Access and Secret Key.

test_valid_sqs_broker_url_no_credentials()

Tests instantiating broker from URL for SQS without keys.

util.test.test_command module

class util.test.test_command.TestEnvironmentExpansion(methodName='runTest')

Bases: django.test.testcases.TestCase

setUp()
test_missing_var_expansion_no_remove()
test_missing_var_expansion_remove()
test_missing_var_expansion_remove_2()
test_multi_instances_var_expansion_success()
test_naked_var_expansion_numeral_success()
test_naked_var_expansion_success()
test_prefixed_var_expansion_success()
test_unmatched_curly_var_expansion_ignored()
test_wrapped_var_expansion_success()

util.test.test_host module

class util.test.test_host.TestUrlExtraction(methodName='runTest')

Bases: django.test.testcases.TestCase

setUp()
test_http_no_port()
test_http_url()
test_https_no_port()
test_https_url()

util.test.test_parse module

class util.test.test_parse.TestParse(methodName='runTest')

Bases: django.test.testcases.TestCase

setUp()
test_duration_to_string()

Tests converting timedelta duration to ISO duration string

test_parse_datetime()

Tests parsing a valid ISO datetime.

test_parse_datetime_invalid()

Tests parsing an invalid ISO datetime.

test_parse_datetime_missing_timezone()

Tests parsing an ISO datetime missing a timezone.

test_parse_duration()

Tests parsing a valid ISO duration.

test_parse_duration_invalid()

Tests parsing an invalid ISO duration.

test_parse_timestamp_datetime()

Tests parsing a valid ISO datetime.

test_parse_timestamp_duration(*args, **keywargs)

Tests parsing a valid ISO duration.

util.test.test_rest module

class util.test.test_rest.TestRest(methodName='runTest')

Bases: django.test.testcases.TestCase

setUp()
test_check_bad_param_type()

Tests checking a white-list of invalid parameters allowed to be updated during a POST.

test_check_time_range()

Tests checking a time range is valid.

test_check_time_range_duration()

Tests checking a time range that is invalid due to max duration exceeded.

test_check_time_range_equal()

Tests checking a time range that is invalid due to being equal.

test_check_time_range_flipped()

Tests checking a time range that is invalid due to start being after end.

test_check_time_range_partial()

Tests checking a partial time range is valid.

test_check_together_all()

Tests checking multiple parameters together.

test_check_together_empty()

Tests checking multiple parameters together when none are given.

test_check_together_none()

Tests checking multiple parameters together when none are given.

test_check_together_partial()

Tests checking multiple parameters together when some are given.

test_check_together_single()

Tests checking multiple parameters together when one is given.

test_check_update()

Tests checking a white-list of parameters allowed to be updated during a POST.

test_check_update_invalid()

Tests checking a white-list of invalid parameters allowed to be updated during a POST.

test_has_params_all()

Tests checking parameter presence when all are given.

test_has_params_empty()

Tests checking parameter presence when none are given.

test_has_params_none()

Tests checking parameter presence when none are given.

test_has_params_partial()

Tests checking parameter presence when some are given.

test_has_params_single()

Tests checking parameter presence when one is given.

test_parse_bool_default()

Tests parsing an optional bool parameter that is provided via default value.

test_parse_bool_false()

Tests parsing a required bool parameter that is provided via GET.

test_parse_bool_missing()

Tests parsing a required bool parameter that is missing.

test_parse_bool_optional()

Tests parsing an optional bool parameter that is missing.

test_parse_bool_post()

Tests parsing a required bool parameter that is provided via POST.

test_parse_bool_true()

Tests parsing a required bool parameter that is provided via GET.

test_parse_datetime()

Tests parsing a valid ISO datetime.

test_parse_datetime_default()

Tests parsing a required ISO datetime parameter that is provided via default value.

test_parse_datetime_invalid()

Tests parsing a required ISO datetime parameter that is formatted incorrectly.

test_parse_datetime_missing()

Tests parsing a required ISO datetime parameter that is missing.

test_parse_datetime_missing_timezone()

Tests parsing an ISO datetime missing a timezone.

test_parse_datetime_optional()

Tests parsing an optional ISO datetime parameter that is missing.

test_parse_dict()

Tests parsing a dictionary.

test_parse_dict_list_invalid_post()

Tests parsing a required list of dictionaries that is not all dictionaries.

test_parse_dict_list_optional()

Tests parsing an optional dict list with no default value.

test_parse_dict_list_post()

Tests parsing a list of dictionaries.

test_parse_dict_optional()

Tests parsing an optional dict with no default value.

test_parse_dict_post()

Tests parsing a dictionary provided via POST.

test_parse_duration()

Tests parsing a required ISO duration parameter that is provided via GET.

test_parse_duration_default()

Tests parsing a required ISO duration parameter that is provided via default value.

test_parse_duration_invalid()

Tests parsing a required ISO duration parameter that is formatted incorrectly.

test_parse_duration_missing()

Tests parsing a required ISO duration parameter that is missing.

test_parse_duration_optional()

Tests parsing an optional ISO duration parameter that is missing.

test_parse_float()

Tests parsing a required float parameter that is provided via GET.

test_parse_float_accepted_none()

Tests parsing a float parameter where the value is not acceptable.

test_parse_float_default()

Tests parsing a required float parameter that is provided via default value.

test_parse_float_invalid()

Tests parsing a required float parameter that is not a valid number.

test_parse_float_missing()

Tests parsing a required float parameter that is missing.

test_parse_float_optional()

Tests parsing an optional float parameter that is missing.

test_parse_float_post()

Tests parsing a required float parameter that is provided via POST.

test_parse_float_valid()

Tests parsing a float parameter where the value is acceptable.

test_parse_float_zero()

Tests parsing an optional float parameter zero instead of using the default value.

test_parse_int()

Tests parsing a required int parameter that is provided via GET.

test_parse_int_accepted_all()

Tests parsing an int parameter where the value is acceptable.

test_parse_int_accepted_none()

Tests parsing an int parameter where the value is not acceptable.

test_parse_int_default()

Tests parsing a required int parameter that is provided via default value.

test_parse_int_invalid()

Tests parsing a required int parameter that is not a valid number.

test_parse_int_list()

Tests parsing a required list of int parameters that is provided via GET.

test_parse_int_list_accepted_all()

Tests parsing a list of int parameters where all values are acceptable.

test_parse_int_list_accepted_none()

Tests parsing a list of int parameters where none of the values are acceptable.

test_parse_int_list_accepted_partial()

Tests parsing a list of int parameters where only some values are acceptable.

test_parse_int_list_default()

Tests parsing a required list of int parameters that are provided via default value.

test_parse_int_list_missing()

Tests parsing a required list of int parameters that are missing.

test_parse_int_list_optional()

Tests parsing an optional list of int parameters that are missing.

test_parse_int_list_post()

Tests parsing a required list of int parameters that are provided via POST.

test_parse_int_missing()

Tests parsing a required int parameter that is missing.

test_parse_int_optional()

Tests parsing an optional int parameter that is missing.

test_parse_int_post()

Tests parsing a required int parameter that is provided via POST.

test_parse_int_zero()

Tests parsing an optional int parameter zero instead of using the default value.

test_parse_string()

Tests parsing a required string parameter that is provided via GET.

test_parse_string_accepted_all()

Tests parsing a string parameter where the value is acceptable.

test_parse_string_accepted_none()

Tests parsing a string parameter where the value is not acceptable.

test_parse_string_default()

Tests parsing an optional string parameter that is provided via default value.

test_parse_string_list()

Tests parsing a required list of string parameters that is provided via GET.

test_parse_string_list_accepted_all()

Tests parsing a list of string parameters where all values are acceptable.

test_parse_string_list_accepted_none()

Tests parsing a list of string parameters where none of the values are acceptable.

test_parse_string_list_accepted_partial()

Tests parsing a list of string parameters where only some values are acceptable.

test_parse_string_list_default()

Tests parsing a required list of string parameters that are provided via default value.

test_parse_string_list_missing()

Tests parsing a required list of string parameters that are missing.

test_parse_string_list_optional()

Tests parsing an optional list of string parameters that are missing.

test_parse_string_list_post()

Tests parsing a required list of string parameters that are provided via POST.

test_parse_string_missing()

Tests parsing a required string parameter that is missing.

test_parse_string_optional()

Tests parsing an optional string parameter that is missing.

test_parse_string_post()

Tests parsing a required string parameter that is provided via POST.

test_parse_timestamp_datetime()

Tests parsing a valid ISO datetime.

test_parse_timestamp_duration(*args, **keywargs)

Tests parsing a valid ISO duration.

test_title_to_name()

Tests parsing an optional dict with no default value.

util.test.test_retry module

class util.test.test_retry.TestRetry(methodName='runTest')

Bases: django.test.testcases.SimpleTestCase

Tests the retry decorator function

always_fail(*args, **kwargs)
always_fail_10_times(*args, **kwargs)
always_fail_no_decorator_args(*args, **kwargs)
success(*args, **kwargs)
success_with_return(*args, **kwargs)
test_always_fail(*args, **keywargs)

Tests retrying always_fail()

test_always_fail_10_times(*args, **keywargs)

Tests retrying always_fail_10_times()

test_always_fail_no_decorator_args(*args, **keywargs)

Tests retrying always_fail_no_decorator_args()

test_success(*args, **keywargs)

Tests retrying success()

test_success_with_return(*args, **keywargs)

Tests retrying success_with_return()

test_wrong_exception(*args, **keywargs)

Tests retrying wrong_exception()

wrong_exception(*args, **kwargs)
class util.test.test_retry.TestRetryDatabaseQuery(methodName='runTest')

Bases: django.test.testcases.SimpleTestCase

Tests the retry_database_query decorator function

always_fail(*args, **kwargs)
success_with_return(*args, **kwargs)
test_always_fail(*args, **keywargs)

Tests retrying always_fail

test_success_with_return(*args, **keywargs)

Tests retrying success_with_return()

Module contents