示例#1
0
def test_delete():
    DummyTab.reset()
    tabs = Tabs(h)
    dummy = DummyTab()
    dummy2 = DummyTab()
    tabs.append(dummy)
    tabs.append(dummy2)

    tabs.delete(dummy)
    assert tabs[0] is dummy2
    assert tabs.by_class(DummyTab) == [dummy2]
    assert tabs['dummy0'] is None
    assert dummy2.nb == 0
示例#2
0
文件: test_tabs.py 项目: louiz/poezio
def test_delete():
    DummyTab.reset()
    tabs = Tabs(h)
    dummy = DummyTab()
    dummy2 = DummyTab()
    tabs.append(dummy)
    tabs.append(dummy2)

    tabs.delete(dummy)
    assert tabs[0] is dummy2
    assert tabs.by_class(DummyTab) == [dummy2]
    assert tabs['dummy0'] is None
    assert dummy2.nb == 0
示例#3
0
def test_delete_other_tab():
    DummyTab.reset()
    tabs = Tabs(h)
    dummy = DummyTab()
    dummy2 = DummyTab()
    dummy3 = DummyTab()
    dummy4 = DummyTab()
    tabs.append(dummy)
    tabs.append(dummy2)
    tabs.append(dummy3)
    tabs.append(dummy4)

    tabs.set_current_tab(dummy4)
    tabs.delete(dummy2)
    assert tabs.current_tab is dummy4
    assert tabs.current_index == 2
    assert dummy.nb == 0
    assert dummy3.nb == 1
    assert dummy4.nb == 2
示例#4
0
文件: test_tabs.py 项目: louiz/poezio
def test_delete_other_tab():
    DummyTab.reset()
    tabs = Tabs(h)
    dummy = DummyTab()
    dummy2 = DummyTab()
    dummy3 = DummyTab()
    dummy4 = DummyTab()
    tabs.append(dummy)
    tabs.append(dummy2)
    tabs.append(dummy3)
    tabs.append(dummy4)

    tabs.set_current_tab(dummy4)
    tabs.delete(dummy2)
    assert tabs.current_tab is dummy4
    assert tabs.current_index == 2
    assert dummy.nb == 0
    assert dummy3.nb == 1
    assert dummy4.nb == 2