Esempio n. 1
0
def test_set_current():
    DummyTab.reset()
    tabs = Tabs(h)
    dummy = DummyTab()
    dummy2 = DummyTab()
    dummy3 = DummyTab()
    tabs.append(dummy)
    tabs.append(dummy2)
    tabs.append(dummy3)

    assert tabs.current_tab is dummy
    tabs.set_current_index(2)
    assert tabs.current_tab is dummy3
    tabs.set_current_tab(dummy2)
    assert tabs.current_tab is dummy2
Esempio n. 2
0
def test_set_current():
    DummyTab.reset()
    tabs = Tabs(h)
    dummy = DummyTab()
    dummy2 = DummyTab()
    dummy3 = DummyTab()
    tabs.append(dummy)
    tabs.append(dummy2)
    tabs.append(dummy3)

    assert tabs.current_tab is dummy
    tabs.set_current_index(2)
    assert tabs.current_tab is dummy3
    tabs.set_current_tab(dummy2)
    assert tabs.current_tab is dummy2
Esempio n. 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
Esempio n. 4
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