def test_env_module_name(sagemaker_program): session_mock = Mock() session_mock.region_name = 'us-west-2' os.environ[_params.USER_PROGRAM_ENV] = sagemaker_program module_name = _env._Env().module_name del os.environ[_params.USER_PROGRAM_ENV] assert module_name == 'program'
def test_env_dictionary(): session_mock = Mock() session_mock.region_name = 'us-west-2' os.environ[_params.USER_PROGRAM_ENV] = 'my_app.py' env = _env._Env() assert len(env) == len(env.properties()) assert env['module_name'] == 'my_app' assert env['log_level'] == logging.INFO
def test_env_dictionary(): session_mock = Mock() session_mock.region_name = "us-west-2" os.environ[_params.USER_PROGRAM_ENV] = "my_app.py" env = _env._Env() assert len(env) == len(env.properties()) assert env["module_name"] == "my_app" assert env["log_level"] == logging.INFO