示例#1
0
def test_read_pyvenv_cfg(tmpdir):
    pyvenv_cfg = tmpdir.join('pyvenv.cfg')
    pyvenv_cfg.write(
        '# I am a comment\n'
        '\n'
        'foo = bar\n'
        'version-info=123\n', )
    expected = {'foo': 'bar', 'version-info': '123'}
    assert python._read_pyvenv_cfg(pyvenv_cfg) == expected
示例#2
0
def test_read_pyvenv_cfg_non_utf8(tmpdir):
    pyvenv_cfg = tmpdir.join('pyvenv_cfg')
    pyvenv_cfg.write_binary('hello = hello john.š\n'.encode())
    expected = {'hello': 'hello john.š'}
    assert python._read_pyvenv_cfg(pyvenv_cfg) == expected