def test_check_xs_uaa_given_valid_VCAP_SERVICES_and_MLP_MLSERVICE_NAME( self): os.environ[MLP_MLSERVICE_NAME] = 'test_bs_name' os.environ[VCAP_SERVICES] = ''' [ { "xsuaa": [ { "credentials": { "uaadomain": "authentication.sap.hana.ondemand.com", "clientid": "sb-test_bs_name!t53", "clientsecret": "little_secret", "url": "https://uaa.com" }, "label": "xsuaa", "name": "test_bs_name", "plan": "application" } ] } ] ''' _prepare_env_vars() self.assertEqual(os.environ[MLP_UAA_BASE_URL], "https://uaa.com") self.assertEqual(os.environ[MLP_UAA_NEW_TOKEN_CLIENT_ID], "sb-test_bs_name!t53") self.assertEqual(os.environ[MLP_UAA_NEW_TOKEN_CLIENT_SECRET], "little_secret")
def setup_env_vars_for_xs_uaa(): os.environ[MLP_MLSERVICE_NAME] = test_ml_service_name os.environ[VCAP_SERVICES] = test_vcap_services os.environ[MLP_USE_XSUAA] = 'true' _prepare_env_vars()
def test_missing_VCAP_SERVICES_should_not_cause_error_at_classloading( self): del os.environ[VCAP_SERVICES] _prepare_env_vars() # only logger is called
def test_missing_MLP_MLSERVICE_NAME_should_not_cause_error_at_classloading( self): del os.environ[MLP_MLSERVICE_NAME] _prepare_env_vars() # only logger is called
def test_prepare_env_vars_should_not_throw_error_if_CLEA_UAA_SERVER_BASE_URL_is_not_set( self): del os.environ[CLEA_UAA_SERVER_BASE_URL] _prepare_env_vars() # only logger is called
def test_check_cf_uaa(self): _prepare_env_vars() # only logger is called