transferpy.test.unit package

Submodules

transferpy.test.unit.test_transfer module

Tests for transfer.py class.

class transferpy.test.unit.test_transfer.TestArgumentParsing(methodName='runTest')[source]

Bases: TestCase

Test cases for the command line arguments parsing.

check_bad_args(args, expected_error=<class 'SystemExit'>)[source]

Check arg parsing fails for the given args.

option_parse(args)[source]

Call parse_args patching the arguments.

test_assign_default_options()[source]

Test assign_default_options function

test_bad_source()[source]

Test errors with the source.

test_bad_target()[source]

Test errors with the target.

test_compress()[source]

Test compress params.

test_encrypt()[source]

Test encrypt params.

test_just_source_and_targets()[source]

Test call with just source and targets.

test_missing_argument()[source]

Test missing argument

test_missing_required_args()[source]

Test errors with missing required args.

test_parallel_checksum()[source]

Test parallel-checksum param.

test_parallel_checksum_and_checksum_true_in_config()[source]

Test for config given True for both parallel-checksum and checksum, checksum should win

test_parallel_checksum_arg_when_checksum_true_by_default()[source]

Test for user given –parallel-checksum argument when the –no-checksum is not mentioned or in other words just the –parallel-checksum should enable parallel-checksum

test_parse_configurations()[source]

test parse configuration file

test_port()[source]

Test port param.

test_remote_execution_verbose()[source]

Test the effect of verbose option on RemoteExecution

test_setup_logger()[source]

Test the logger’s global availability and the impact of the verbose option on the logger level.

test_split_target()[source]

Test split_target function

test_verbose()[source]

Test verbose param.

test_winner_among_cli_and_config()[source]

Test the context of disagreement between command line arguments and configuration file arguments: command line arguments should get first preference.

class transferpy.test.unit.test_transfer.TestFirewall(methodName='runTest')[source]

Bases: TestCase

Test cases for Firewall module

setUp(executor_mock)[source]

Hook method for setting up the test fixture before exercising it.

test_close()[source]

Test for close function failure

test_close_gets_port_from_open()[source]

Test case for Firewall.close function, close takes port number from Firewall.target_port which is set by Firewall.open

test_find_available_port()[source]

Test for find_available_port function

test_find_pid()[source]

Test for find_pid

test_kill_process()[source]

Test for kill_process

test_no_available_port()[source]

Test for find_available_port function when no ports are available

test_open_failure()[source]

Test for open function failure

test_open_with_auto_port_finding()[source]

Test for open function with automatic port finding

test_open_with_given_non_available_port()[source]

Test for open function with a given port which is not available at the target host

test_open_with_given_port()[source]

Test for open function with a given port

test_reserve_port()[source]

Test for Firewall reserve_port function

test_unreserve_port()[source]

Test for Firewall unreserve_port function

class transferpy.test.unit.test_transfer.TestTransferer(methodName='runTest')[source]

Bases: TestCase

setUp(executor_mock)[source]

Hook method for setting up the test fixture before exercising it.

test_after_transfer_checks()[source]

Test after_transfer_checks

test_calculate_checksum_for_dir()[source]
test_calculate_checksum_for_file()[source]
test_compress_command_compressing()[source]
test_compress_command_not_compressing()[source]
test_copy_to_failure()[source]

Test case for the failed run of Transferer.copy_to function

test_copy_to_success()[source]

Test case for the successful run of Transferer.copy_to function

test_decompress_command_compressing()[source]
test_decompress_command_not_compressing()[source]
test_decrypt_command_encrypting()[source]
test_decrypt_command_not_encrypting()[source]
test_dir_is_empty()[source]

Test dir_is_empty

test_disk_usage()[source]
test_encrypt_command_encrypting()[source]
test_encrypt_command_not_encrypting()[source]
test_file_exists()[source]
test_get_datadir_from_socket()[source]

Test get_datadir_from_socket

test_has_available_disk_space()[source]
test_host_exists()[source]

Test host_exists

test_is_dir()[source]
test_is_socket()[source]

Test is_socket

test_mbstream_command()[source]

Test mbstream_command

test_netcat_listen_command()[source]

Test netcat_listen_command

test_netcat_send_command()[source]

Test netcat_send_command

test_parallel_checksum_source_and_target_command()[source]

Test to check the parallel_checksum command

test_parallel_checksum_source_command()[source]

Test parallel_checksum_source_command

test_parallel_checksum_target_command()[source]

Test parallel_checksum_target_command

test_password()[source]

Test password function

test_read_checksum()[source]

Test read_checksum

test_remote_execution_injection()[source]
test_run_command()[source]
test_run_sanity_checks_failing()[source]

Test case for Transferer.run function which simulates sanity check failure.

test_run_start_slave()[source]

Test case for Transferer.run function for when it runs the start_slave function with the stop_slave option

test_run_stoping_slave()[source]

Test case for Transferer.run function which provides stop_slave option

test_run_successfully()[source]

Test case for Transferer.run function starting transfer successfully

test_sanity_checks_file()[source]

Test sanity_checks for file/dir

test_sanity_checks_xtrabackup()[source]

Test sanity_checks for xtrabackup/decompress

test_tar_command()[source]

Test tar_command

test_untar_command()[source]

Test untar_command

test_xtrabackup_command()[source]

Test xtrabackup_command

Module contents

transferpy unit tests.