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={}) 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_pexrc_precedence(): # type: () -> None with named_temporary_file(mode="w") as pexrc: pexrc.write("HELLO=FORTYTWO") pexrc.flush() v = Variables(rc=pexrc.name, environ={"HELLO": "42"}) assert v._get_int("HELLO") == 42
def test_pex_from_rc(): # type: () -> None with named_temporary_file(mode="w") as pexrc: pexrc.write("HELLO=42") pexrc.flush() v = Variables(rc=pexrc.name) assert v._get_int("HELLO") == 42
def test_pexrc_precedence(): with named_temporary_file(mode='w') as pexrc: pexrc.write('HELLO=FORTYTWO') pexrc.flush() v = Variables(rc=pexrc.name, environ={'HELLO': 42}) assert v._get_int('HELLO') == 42
def test_pex_from_rc(): with named_temporary_file(mode='w') as pexrc: pexrc.write('HELLO=42') pexrc.flush() v = Variables(rc=pexrc.name) assert v._get_int('HELLO') == 42
def test_pexrc_precedence(): with named_temporary_file(mode='w') as pexrc: pexrc.write('HELLO=FORTYTWO') pexrc.flush() v = Variables(rc=pexrc.name, environ={'HELLO': 42}) assert v._get_int('HELLO') == 42
def test_pex_from_rc(): with named_temporary_file(mode='w') as pexrc: pexrc.write('HELLO=42') pexrc.flush() v = Variables(rc=pexrc.name) assert v._get_int('HELLO') == 42
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()
def test_pexrc_precedence(): with tempfile.NamedTemporaryFile(mode="w") as pexrc: pexrc.write("HELLO=FORTYTWO") pexrc.flush() v = Variables(environ={"HELLO": 42}, rc=pexrc.name) assert v._get_int("HELLO") == 42
def test_pex_from_rc(): with tempfile.NamedTemporaryFile(mode="w") as pexrc: pexrc.write("HELLO=42") pexrc.flush() v = Variables(rc=pexrc.name) assert v._get_int("HELLO") == 42
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
def test_pexrc_precedence(): with tempfile.NamedTemporaryFile(mode='w') as pexrc: pexrc.write('HELLO=FORTYTWO') pexrc.flush() v = Variables(environ={'HELLO': 42}, rc=pexrc.name) assert v._get_int('HELLO') == 42