示例#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