소스 검색

add test for NoTabCheckBox

Daniel Sheffield 1 년 전
부모
커밋
d899eef80a
1개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. 13 1
      test/test_widgets.py

+ 13 - 1
test/test_widgets.py

@@ -13,6 +13,7 @@ from app.rest import ALL_UNITS
 from app.widgets import (
     SuggestionPopup,
     FlowBarGraphWithVScale,
+    NoTabCheckBox,
 )
 
 @fixture
@@ -69,4 +70,15 @@ def test_flow_bar_graph_with_vscale(bargraph: FlowBarGraphWithVScale, vscale: Tu
     assert bargraph.total_width == 50
     assert bargraph.canvas_width == 50 - bargraph._vscale_width
     assert bargraph.height == 14
-    bargraph.set_bar_width(2)
+    bargraph.set_bar_width(2)
+
+@fixture
+def notabcheckbox():
+    return NoTabCheckBox('label')
+
+def test_no_tab_checkbox(notabcheckbox: NoTabCheckBox):
+    state = notabcheckbox.get_state()
+    notabcheckbox.keypress((0,0), 'tab')
+    assert notabcheckbox.get_state() == state
+    notabcheckbox.keypress((0,0), 'enter')
+    assert notabcheckbox.get_state() != state