MCPcopy Create free account
hub / github.com/bugy/script-server / custom_env

Function custom_env

src/tests/test_utils.py:394–405  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

392
393
394def custom_env(*args):
395 if len(args) == 0:
396 raise Exception('No env variables are specified')
397
398 if len(args) == 1 and isinstance(args[0], dict):
399 key_values = args[0]
400 elif len(args) % 2 != 0:
401 raise Exception('Even number of arguments is expected')
402 else:
403 key_values = {args[i]: args[i + 1] for i in range(0, len(args), 2)}
404
405 return CustomEnvScope(key_values)
406
407
408def set_os_environ_value(key, value):

Callers

nothing calls this directly

Calls 1

CustomEnvScopeClass · 0.85

Tested by

no test coverage detected