Exemple #1
0
def test_rcfile_write():
    f = rcfile()
    f['font.family'] = 'Consolas'
    fname = tempfile.mktemp()
    f.write(fname)

    f2 = rcfile(fname)
    f2.read()

    assert f2['font.family'] == 'Consolas'
Exemple #2
0
def test_rcfile_init():
    f = rcfile()

    assert f.parser is None
Exemple #3
0
def test_rcfile_getsubitem():
    f = rcfile()
    f.reads(u"[font]\ntext.family=Consolas")

    assert f['font.text.family'] == 'Consolas'
Exemple #4
0
def test_rcfile_setitem():
    f = rcfile()
    f['font.family'] = 'Consolas'

    assert f['font.family'] == 'Consolas'
Exemple #5
0
def test_rcfile_default_config():
    f = rcfile()
    f.read()

    assert f.has_section('font')
    assert f.has_section('color')