예제 #1
0
파일: private.py 프로젝트: vbansal22/deis
def _construct_env(config):
    "Update current environment with latest config"
    new_env = []
    # add config ENV items
    for k, v in config.items():
        new_env.append("{}={}".format(encode(k), encode(v)))
    return new_env
예제 #2
0
def _construct_env(env, config):
    "Update current environment with latest config"
    new_env = []
    # see if we need to update existing ENV vars
    for e in env:
        k, v = e.split('=', 1)
        if k in config:
            # update values defined by config
            v = config.pop(k)
        new_env.append("{}={}".format(encode(k), encode(v)))
    # add other config ENV items
    for k, v in config.items():
        new_env.append("{}={}".format(encode(k), encode(v)))
    return new_env
예제 #3
0
파일: private.py 프로젝트: Wealth39/deis
def _construct_env(env, config):
    "Update current environment with latest config"
    new_env = []
    # see if we need to update existing ENV vars
    for e in env:
        k, v = e.split('=', 1)
        if k in config:
            # update values defined by config
            v = config.pop(k)
        new_env.append("{}={}".format(encode(k), encode(v)))
    # add other config ENV items
    for k, v in config.items():
        new_env.append("{}={}".format(encode(k), encode(v)))
    return new_env
예제 #4
0
    def test_base62_encode_zero(self):
        n = 0
        encoded_digit = encode(n)

        assert "0" == encoded_digit
예제 #5
0
    def test_base62_encode_large_number(self):
        n = 3213213
        encoded_n = encode(n)

        assert "dtU1" == encoded_n
예제 #6
0
    def test_base62_encode_small_number(self):
        n = 10
        encoded_n = encode(n)

        assert "a" == encoded_n
예제 #7
0
    def test_base62_encode_digit(self):
        n = 4
        encoded_digit = encode(n)

        assert str(n) == encoded_digit