forked from npcole/npyscreen
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTESTING-DEBUG-APP.py
More file actions
executable file
·33 lines (24 loc) · 986 Bytes
/
TESTING-DEBUG-APP.py
File metadata and controls
executable file
·33 lines (24 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/python
import curses
import osc_npyscreen
import unittest
osc_npyscreen.add_test_input_from_iterable('This is a test')
osc_npyscreen.TEST_SETTINGS['TEST_INPUT'].append(curses.KEY_DOWN)
osc_npyscreen.TEST_SETTINGS['TEST_INPUT'].append("^X")
osc_npyscreen.TEST_SETTINGS['CONTINUE_AFTER_TEST_INPUT'] = True
class TestForm(osc_npyscreen.FormWithMenus):
def create(self):
self.myTitleText = self.add(osc_npyscreen.TitleText, name="Events (Form Controlled):", editable=True)
class TestApp(osc_npyscreen.StandardApp):
def onStart(self):
self.addForm("MAIN", TestForm)
class Tests(unittest.TestCase):
def setUp(self):
self.testApp = TestApp()
def test_text_entry(self):
osc_npyscreen.TEST_SETTINGS['TEST_INPUT'] = [ch for ch in 'This is a test']
osc_npyscreen.TEST_SETTINGS['TEST_INPUT'].append(curses.KEY_DOWN)
if __name__ == '__main__':
#TestMemory()
A = TestApp()
A.run()