def test_move_up_down(self): title = 'Please choose an option: ' options = ['option1', 'option2', 'option3'] picker = Picker(options, title) picker.move_up() assert picker.get_selected() == ('option3', 2) picker.move_down() picker.move_down() assert picker.get_selected() == ('option2', 1)
def test_pick(self): title = 'Please choose an option: ' options = ['option1', 'option2', 'option3'] picker = Picker(options, title) picker.move_up() assert picker.get_selected() == ('option3', 2) picker.move_down() picker.move_down() assert picker.get_selected() == ('option2', 1)
def test_multi_select(self): title = 'Please choose an option: ' options = ['option1', 'option2', 'option3'] picker = Picker(options, title, multi_select=True, min_selection_count=1) assert picker.get_selected() == [] picker.mark_index() assert picker.get_selected() == [('option1', 0)] picker.move_down() picker.mark_index() assert picker.get_selected() == [('option1', 0), ('option2', 1)]