tests.test_cli¶
Location: Pulp Smash → API Documentation → tests.test_cli
Unit tests for pulp_smash.cli.
-
class
tests.test_cli.ClientTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTests for
pulp_smash.cli.Client.-
test_default_response_handler()¶ Assert the default response handler checks return codes.
-
test_explicit_local_transport()¶ Assert it is possible to explicitly ask for a “local” transport.
-
test_explicit_pulp_host()¶ Assert it is possible to explicitly target a pulp cli PulpHost.
-
test_explicit_response_handler()¶ Assert it is possible to explicitly set a response handler.
-
test_implicit_local_transport()¶ Assert it is possible to implicitly ask for a “local” transport.
-
test_implicit_pulp_host()¶ Assert it is possible to implicitly target a pulp cli PulpHost.
-
test_run()¶ Test run commands.
-
test_run_as_sudo()¶ Test run commands as sudo.
-
-
class
tests.test_cli.CodeHandlerTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTests for
pulp_smash.cli.code_handler().-
classmethod
setUpClass()¶ Call the function under test, and record inputs and outputs.
-
test_check_returncode()¶ Assert
completed_proc.check_returncode()is not called.
-
test_input_returned()¶ Assert the passed-in
completed_procis returned.
-
classmethod
-
class
tests.test_cli.CompletedProcessTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTests for
pulp_smash.cli.CompletedProcess.-
setUp()¶ Generate kwargs that can be used to instantiate a completed proc.
-
test_can_eval()¶ Assert
__repr__()can be parsed byeval().
-
test_check_returncode_nonzero()¶ Call
check_returncodewhenreturncodeis not zero.
-
test_check_returncode_zero()¶ Call
check_returncodewhenreturncodeis zero.
-
test_init()¶ Assert all constructor arguments are saved as instance attrs.
-
-
class
tests.test_cli.EchoHandlerTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTests for
pulp_smash.cli.echo_handler().-
classmethod
setUpClass()¶ Call the function under test, and record inputs and outputs.
-
test_check_returncode()¶ Assert
completed_proc.check_returncode()is not called.
-
test_input_returned()¶ Assert the passed-in
completed_procis returned.
-
classmethod
-
class
tests.test_cli.IsRootTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTests for
pulp_smash.cli.is_root.-
test_negative()¶ Test what happens when we aren’t root on the target host.
-
test_positive()¶ Test what happens when we are root on the target host.
-
-
class
tests.test_cli.PackageManagerTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTests for
pulp_smash.cli.PackageManager.-
classmethod
setUpClass()¶ Set common cfg for all tests.
-
test_apply_erratum()¶ Test apply erratum is called for supported package managers.
-
test_install()¶ Test client is called with installation command.
-
test_package_manager_name()¶ Test the property name returns the proper Package Manager.
-
test_raise_if_unsupported()¶ Test if proper exception raises on raise_if_unsupported.
-
test_raise_no_known_package_manager()¶ Test if invalid package manager throws exception.
-
test_uninstall()¶ Test client is called with uninstallation command.
-
test_upgrade()¶ Test client is called with upgrade command.
-
classmethod