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
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
def test_base62_encode_zero(self): n = 0 encoded_digit = encode(n) assert "0" == encoded_digit
def test_base62_encode_large_number(self): n = 3213213 encoded_n = encode(n) assert "dtU1" == encoded_n
def test_base62_encode_small_number(self): n = 10 encoded_n = encode(n) assert "a" == encoded_n
def test_base62_encode_digit(self): n = 4 encoded_digit = encode(n) assert str(n) == encoded_digit