Ejemplo n.º 1
0
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()
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
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
Ejemplo n.º 7
0
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
Ejemplo n.º 8
0
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
Ejemplo n.º 9
0
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()
Ejemplo n.º 10
0
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
Ejemplo n.º 11
0
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
Ejemplo n.º 12
0
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
Ejemplo n.º 13
0
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