Updated tests.py to add my newest checks
This commit is contained in:
parent
4f1b59efeb
commit
ecad7e2403
36
tests.py
36
tests.py
@ -1,6 +1,7 @@
|
||||
from lcdMenu import lcdMenu
|
||||
import config
|
||||
from config import LCD
|
||||
from time import sleep
|
||||
|
||||
"""
|
||||
# testing different icon styles
|
||||
@ -18,6 +19,7 @@ LCD.putstr(chr(0)+" "+chr(1)+" "+chr(2)+" "+chr(3)+" "+chr(4)+" "+chr(5)+" <>"
|
||||
#LCD.putstr("< >< some tst itm >")
|
||||
LCD.putstr("[ ------------ ]< some tst itm >")
|
||||
|
||||
sleep(1)
|
||||
|
||||
def some_print():
|
||||
print("some_print() executed!")
|
||||
@ -26,27 +28,27 @@ def another_callback():
|
||||
def third():
|
||||
print("third")
|
||||
return True
|
||||
|
||||
|
||||
menuItems = [("some_print", some_print),
|
||||
("another_entry", another_callback),
|
||||
("third item", third)]
|
||||
lm = lcdMenu(config.LCD,
|
||||
{"next_btn": config.BTN_1, "ok_btn": config.BTN_2},
|
||||
submenu = lcdMenu(config.LCD,
|
||||
{"next_btn": config.BTN_2, "ok_btn": config.BTN_1},
|
||||
menuItems,
|
||||
scroll_direction=True, cycle=True,
|
||||
hide_menu_name=False)
|
||||
|
||||
print(lm.current_selection)
|
||||
lm.next_selection()
|
||||
print(lm.current_selection)
|
||||
lm.next_selection()
|
||||
print(lm.current_selection)
|
||||
lm.next_selection()
|
||||
print(lm.current_selection)
|
||||
print("--------")
|
||||
print(lm.current_selection)
|
||||
lm.previous_selection()
|
||||
print(lm.current_selection)
|
||||
lm.previous_selection()
|
||||
print(lm.current_selection)
|
||||
lm.previous_selection()
|
||||
print(lm.current_selection)
|
||||
mainmenu = lcdMenu(config.LCD,
|
||||
{"next_btn": config.BTN_2, "ok_btn": config.BTN_1},
|
||||
[("submenu",submenu.run)],
|
||||
scroll_direction=True, cycle=True,
|
||||
hide_menu_name=False)
|
||||
|
||||
mainmenu.next_selection()
|
||||
mainmenu.previous_selection()
|
||||
|
||||
print("-------\nNow running!\n-------")
|
||||
|
||||
submenu.run()
|
||||
#mainmenu.run()
|
Loading…
Reference in New Issue
Block a user