tests.test_config¶
Location: Pulp Smash → API Documentation → tests.test_config
Unit tests for pulp_smash.config.
-
class
tests.test_config.GetConfigFileLoadPathTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTest
pulp_smash.config.PulpSmashConfig.get_load_path().-
test_failures()¶ Assert the method raises an exception when no config is found.
-
test_success()¶ Assert the method returns a path when a config file is found.
-
-
class
tests.test_config.GetConfigTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTest
pulp_smash.config.get_config().-
test_cache_empty()¶ A config is loaded from disk if the cache is empty.
-
test_cache_full()¶ No config is loaded from disk if the cache is populated.
-
-
class
tests.test_config.GetRequestsKwargsTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTest
pulp_smash.config.PulpSmashConfig.get_requests_kwargs().-
classmethod
setUpClass()¶ Create a mock server config and call the method under test.
-
test_cfg_auth()¶ Assert that the method does not alter the config’s
auth.
-
test_kwargs()¶ Assert that the method returns correct values.
-
test_kwargs_auth()¶ Assert that the method converts
authto a tuple.
-
classmethod
-
class
tests.test_config.HelperMethodsTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTest
pulp_smash.config.PulpSmashConfig()helper methods.-
setUp()¶ Generate contents for a configuration file.
-
test_get_hosts()¶ get_hostsreturns proper result.
-
test_get_services()¶ get_servicesreturns proper result.
-
-
class
tests.test_config.LoadTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTest
pulp_smash.config.PulpSmashConfig.load().-
do_validate(cfg)¶ Validate the attributes of a configuration object.
-
test_load_config_file()¶ Ensure Pulp Smash can load the config file.
-
-
class
tests.test_config.PulpSmashConfigFileTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseVerify the
PULP_SMASH_CONFIG_FILEenvironment var is respected.-
test_var_set()¶ Set the environment variable.
-
test_var_unset()¶ Do not set the environment variable.
-
-
class
tests.test_config.ReprTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTest calling
repron a pulp_smash.config.PulpSmashConfig.-
classmethod
setUpClass()¶ Generate attributes and call the method under test.
-
test_can_eval()¶ Assert that the result can be parsed by
eval.
-
test_is_sane()¶ Assert that the result is in an expected set of results.
-
classmethod
-
class
tests.test_config.ValidateConfigTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseTest
pulp_smash.config.validate_config().-
test_config_missing_roles()¶ Missing required roles in config raises an exception.
-
test_invalid_config()¶ An invalid config raises an exception.
-
test_valid_config()¶ A valid config does not raise an exception.
-
-
tests.test_config.pulp_smash_config_load(config_str)¶ Load an in-memory configuration file.
Parameters: config_str – A string. An in-memory configuration file. Returns: A pulp_smash.config.PulpSmashConfigobject, populated from the configuration file.