def assert_pex_vars_hermetic(): v = Variables() assert os.environ == v.copy() existing = os.environ.get('TEST') expected = (existing or '') + 'different' assert expected != existing with environment_as(TEST=expected): assert expected != v.copy().get('TEST')
def assert_pex_vars_hermetic(): # type: () -> None v = Variables() assert os.environ.copy() == v.copy() existing = os.environ.get("TEST") expected = (existing or "") + "different" assert expected != existing with environment_as(TEST=expected): assert expected != v.copy().get("TEST")
def test_pex_vars_set(): v = Variables(environ={}) v.set('HELLO', '42') assert v._get_int('HELLO') == 42 v.delete('HELLO') assert v._get_int('HELLO') is None assert {} == v.copy()
def test_pex_vars_set(): v = Variables(environ={}) assert v._get_int('HELLO') is None v.set('HELLO', '42') assert v._get_int('HELLO') == 42 assert {'HELLO': '42'} == v.copy()