예제 #1
0
    def _prepare_environment(self, func_details):
        # setup environment pre-defined variables for docker environment
        result = func_details.envvars.copy()

        # injecting aws credentials into docker environment if not provided
        aws_stack.inject_test_credentials_into_env(result)
        # injecting the region into the docker environment
        aws_stack.inject_region_into_env(result, func_details.region())

        return result
예제 #2
0
def test_inject_region_into_env_already_with_region_overwrites_it():
    env = {"AWS_REGION": "another-region"}
    region = "a-test-region"
    inject_region_into_env(env, region)
    assert env.get("AWS_REGION") == region
예제 #3
0
def test_inject_region_into_env_already_with_none_adds_region():
    env = {}
    region = "a-test-region"
    inject_region_into_env(env, region)
    assert env.get("AWS_REGION") == region