Exemple #1
0
def test_debug_exporter_maybe_enable_buttons(
        scrollbar_value, scrolbar_maximum, is_enabled):
    de = DebugExporter(None)
    fake_scrollbar = Mock()
    fake_scrollbar.maximum = Mock(return_value=scrolbar_maximum)
    de.scrollbar = fake_scrollbar
    de.maybe_enable_buttons(scrollbar_value)
    assert de.copy_button.isEnabled() == is_enabled
def test_debug_exporter_on_checkbox_state_changed_keep_scrollbar_position():
    de = DebugExporter(None)
    fake_scrollbar = Mock()
    fake_scrollbar.value = Mock(return_value=99)
    fake_setValue = Mock()
    fake_scrollbar.setValue = fake_setValue
    de.scrollbar = fake_scrollbar
    de.on_checkbox_state_changed(0)
    assert de.scrollbar.setValue.call_args[0][0] == 99