def test_check_env_variables_with_ci_debug(self, mock_logger_warn, mock_logger_info): CONST.CI_DEBUG = mock.Mock() prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_info.assert_any_call(test_utils. SubstrMatch(" CI_DEBUG="))
def test_check_env_variables_missing_inst_type(self, mock_logger_warn, mock_logger_info): CONST.INSTALLER_TYPE = None prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_warn.assert_any_call("The env variable 'INSTALLER_TYPE'" " is not defined.")
def test_check_env_variables_with_scenario(self, mock_logger_warn, mock_logger_info): CONST.DEPLOY_SCENARIO = mock.Mock() prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_info.assert_any_call(test_utils. SubstrMatch("DEPLOY_SCENARIO="))
def test_check_env_variables_with_inst_ip(self, mock_logger_warn, mock_logger_info): CONST.INSTALLER_IP = mock.Mock() prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_info.assert_any_call(test_utils. SubstrMatch(" INSTALLER_IP="))
def test_check_env_variables_with_node(self, mock_logger_warn, mock_logger_info): CONST.NODE_NAME = mock.Mock() prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_info.assert_any_call(test_utils. SubstrMatch(" NODE_NAME="))
def test_check_env_variables_missing_scenario(self, mock_logger_warn, mock_logger_info): CONST.DEPLOY_SCENARIO = None prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_warn.assert_any_call("The env variable" " 'DEPLOY_SCENARIO' is not defined" ". Setting CI_SCENARIO=undefined.")
def test_check_env_variables_with_is_ci_run(self, mock_logger_warn, mock_logger_info): CONST.IS_CI_RUN = mock.Mock() prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_info.assert_any_call(test_utils. SubstrMatch(" IS_CI_RUN="))
def test_check_env_variables_with_build_tag(self, mock_logger_warn, mock_logger_info): CONST.BUILD_TAG = mock.Mock() prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_info.assert_any_call(test_utils. SubstrMatch(" BUILD_TAG="))
def test_check_env_variables_missing_inst_ip(self, mock_logger_warn, mock_logger_info): CONST.__setattr__('INSTALLER_IP', None) prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_warn.assert_any_call( "The env variable 'INSTALLER_IP' is not defined. It is recommended" " to extract some information from the deployment")
def test_check_env_variables_missing_inst_ip(self, mock_logger_warn, mock_logger_info): CONST.INSTALLER_IP = None prepare_env.check_env_variables() mock_logger_info.assert_any_call("Checking environment variables" "...") mock_logger_warn.assert_any_call("The env variable 'INSTALLER_IP'" " is not defined. It is needed to" " fetch the OpenStack credentials." " If the credentials are not" " provided to the container as a" " volume, please add this env" " variable to the 'docker run'" " command.")