def test_console_rexpaint_list_save_load(console, tmpdir):
    con1 = libtcodpy.console_new(8, 2)
    con2 = libtcodpy.console_new(8, 2)
    libtcodpy.console_print(con1, 0, 0, 'hello')
    libtcodpy.console_print(con2, 0, 0, 'world')
    xp_file = tmpdir.join('test.xp').strpath
    assert libtcodpy.console_list_save_xp([con1, con2], xp_file, 1)
    for a, b in zip([con1, con2], libtcodpy.console_list_load_xp(xp_file)):
        assertConsolesEqual(a, b)
        libtcodpy.console_delete(a)
        libtcodpy.console_delete(b)
Beispiel #2
0
def test_console_rexpaint_list_save_load(console, tmpdir):
    con1 = libtcodpy.console_new(8, 2)
    con2 = libtcodpy.console_new(8, 2)
    libtcodpy.console_print(con1, 0, 0, 'hello')
    libtcodpy.console_print(con2, 0, 0, 'world')
    xp_file = tmpdir.join('test.xp').strpath
    assert libtcodpy.console_list_save_xp([con1, con2], xp_file, 1)
    for a, b in zip([con1, con2], libtcodpy.console_list_load_xp(xp_file)):
        assertConsolesEqual(a, b)
        libtcodpy.console_delete(a)
        libtcodpy.console_delete(b)