MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / test_RangeManager_9

Function test_RangeManager_9

pyxrf/gui_module/tests/test_useful_widgets.py:642–667  ·  view source on GitHub ↗

Entering invalid value in an entry field (especially the case when text contains `,`)

(qtbot, full_range, selection, value_type)

Source from the content-addressed store, hash-verified

640])
641# fmt: on
642def test_RangeManager_9(qtbot, full_range, selection, value_type):
643 """Entering invalid value in an entry field (especially the case when text contains `,`)"""
644
645 slider_steps = 1000
646 selection_to_range_min = 0.01
647
648 rman = RangeManager(slider_steps=slider_steps, selection_to_range_min=selection_to_range_min)
649 qtbot.addWidget(rman)
650 rman.show()
651
652 rman.set_range(full_range[0], full_range[1])
653 rman.set_selection(value_low=selection[0], value_high=selection[1])
654
655 assert rman.get_selection() == selection, "Incorrect selection"
656
657 enter_text_via_keyboard(qtbot, rman.le_min_value, "abc", finish=True)
658 assert rman.get_selection() == selection, "Incorrect selection"
659
660 enter_text_via_keyboard(qtbot, rman.le_min_value, "10,", finish=True)
661 assert rman.get_selection() == selection, "Incorrect selection"
662
663 enter_text_via_keyboard(qtbot, rman.le_max_value, "abc", finish=True)
664 assert rman.get_selection() == selection, "Incorrect selection"
665
666 enter_text_via_keyboard(qtbot, rman.le_max_value, "10.0,", finish=True)
667 assert rman.get_selection() == selection, "Incorrect selection"

Callers

nothing calls this directly

Calls 6

set_rangeMethod · 0.95
set_selectionMethod · 0.95
get_selectionMethod · 0.95
RangeManagerClass · 0.90
enter_text_via_keyboardFunction · 0.85
showMethod · 0.80

Tested by

no test coverage detected