Esempio n. 1
0
def test_checks_display_not_warning(windows, dialog_sleep):
    """Test displaying checks for a situation that do not allow enqueuing.

    """
    dial = ChecksDisplay(errors={'test': 'dummy', 'complex': {'rr': 'tt'}})

    dial.show()
    process_app_events()
    sleep(dialog_sleep)

    assert len(dial.central_widget().widgets()) == 2

    dial.central_widget().widgets()[-1].clicked = True
    process_app_events()
    assert not dial.result
Esempio n. 2
0
def test_checks_display_warning(windows, dialog_sleep):
    """Test displaying checks that allow enqueuing.

    """
    dial = ChecksDisplay(errors={'test': 'dummy', 'internal': {'rr': 'tt'}},
                         is_warning=True)

    dial.show()
    process_app_events()
    sleep(dialog_sleep)

    assert len(dial.central_widget().widgets()) == 3

    dial.central_widget().widgets()[-1].clicked = True
    process_app_events()

    assert dial.result
def test_checks_display_not_warning(windows, dialog_sleep):
    """Test displaying checks for a situation that do not allow enqueuing.

    """
    dial = ChecksDisplay(errors={'test': 'dummy', 'complex': {'rr': 'tt'}})

    dial.show()
    process_app_events()
    sleep(dialog_sleep)

    assert len(dial.central_widget().widgets()) == 2

    dial.central_widget().widgets()[-1].clicked = True
    process_app_events()
    assert not dial.result
Esempio n. 4
0
def test_checks_display_not_warning_force_enqueue(windows, dialog_sleep):
    """Test displaying checks for a situation that do not allow enqueuing.

    """
    dial = ChecksDisplay(errors={'test': 'dummy', 'complex': {'rr': 'tt'}})

    dial.show()
    process_app_events()
    sleep(dialog_sleep)

    assert dial.central_widget().widgets()[-1].text == 'Force enqueue'

    with handle_question('yes'):
        dial.central_widget().widgets()[-1].clicked = True
    process_app_events()
    assert dial.result
Esempio n. 5
0
def test_checks_display_warning(windows, dialog_sleep):
    """Test displaying checks that allow enqueuing.

    """
    dial = ChecksDisplay(errors={
        'test': 'dummy',
        'internal': {
            'rr': 'tt'
        }
    },
                         is_warning=True)

    dial.show()
    process_app_events()
    sleep(dialog_sleep)

    assert dial.central_widget().widgets()[-1].text == 'Enqueue'

    dial.central_widget().widgets()[-1].clicked = True
    process_app_events()

    assert dial.result