ska.tests package

Submodules

ska.tests.base module

ska.tests.base.log_info(func)[source]

Prints some useful info.

ska.tests.base.parse_url_params(url)[source]

Parses URL params.

Parameters:

url (str) –

Return dict:

ska.tests.base.timestamp_to_human_readable(timestamp)[source]

Convert Unix timestamp to human readable string.

Parameters:

timestamp

Return str:

ska.tests.test_commands module

class ska.tests.test_commands.GenerateSignedUrlTest(methodName='runTest')[source]

Bases: TestCase

Tests of generate_signed_url module and ska-sign-url script.

setUp()[source]

Set up.

test_generate_signed_url()[source]

Test generate_signed_url module.

Returns:

ska.tests.test_core module

class ska.tests.test_core.ExtraTest(methodName='runTest')[source]

Bases: TestCase

Test for extra data.

setUp()[source]

Set up.

test_01_sign_url_and_validate_signed_request_data()[source]

Tests for sign_url and validate_signed_request_data.

test_02_sign_url_validate_signed_req_data_tamper_extra_keys_rm()[source]

Fail tests for sign_url and validate_signed_request_data.

As well as providing the additional data extra and data tampering extra keys (remove).

test_03_sign_url_and_validate_signed_req_data_tamper_extra_keys_add()[source]

Fail tests for sign_url and validate_signed_request_data.

As well as providing the additional data extra and data tampering extra keys (add).

test_04_sgn_url_vldt_signed_request_data_tamper_extra_keys_add()[source]

Tests for sign_url and validate_signed_request_data.

As well as providing the additional data extra and data tampering extra keys (add) repeated params.

class ska.tests.test_core.ShortcutsTest(methodName='runTest')[source]

Bases: TestCase

Tests for shortcut functions.

The following shortcut functions are tested: sign_url, signature_to_dict and validate_signed_request_data.

setUp()[source]

Set up.

test_01_sign_url_and_validate_signed_request_data()[source]

Tests for sign_url & validate_signed_request_data.

test_02_sign_url_and_validate_signed_request_data_fail()[source]

Fail tests for sign_url & validate_signed_request_data.

test_03_signature_to_dict_and_validate_signed_request_data()[source]

Tests for signature_to_dict & validate_signed_request_data.

test_04_sig_to_dict_var_types_and_validate_signed_request_data()[source]

Tests for signature_to_dict with complex data & validate_signed_request_data.

class ska.tests.test_core.SignatureTest(methodName='runTest')[source]

Bases: TestCase

Tests of ska.Signature class.

setUp()[source]

Set up.

test_01_signature_test()[source]

Signature test.

test_02_signature_test_with_positive_time_lapse()[source]

Signature test with positive time-lapse.

When signature is made on a host that has a positive (greater) time difference with server. In this particular example, the host time is 5 minutes ahead the server time.

test_03_signature_test_with_negative_time_lapse()[source]

Fail test. Signature test with negative time-lapse.

When signature is made on a host that has a negative (less) time difference with server. In this particular example, the host time is 5 minutes behind the server time, which exceeds the signature lifetime.

test_04_fail_signature_test()[source]

Fail signature tests.

test_05_fail_signature_test_validation_result_class()[source]

Fail signature tests of the ValidationResult class.

class ska.tests.test_core.URLHelperTest(methodName='runTest')[source]

Bases: TestCase

Tests of ska.URLHelper class.

setUp()[source]

Set up.

test_01_signature_to_url()[source]

Signature test.

test_02_signature_to_url_fail()[source]

Signature test. Fail test.

Module contents