forked from KyleLopin/Potentiostat_GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_pre.py
33 lines (26 loc) · 907 Bytes
/
test_pre.py
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
# standard libraries
import unittest
from unittest import mock
from unittest.mock import patch
# local files
from app import amp_gui
class TestUSBHandler(unittest.TestCase):
@patch('builtins.print')
def build_up(self, mock_print):
root = amp_gui.ElectroChemGUI()
return root, mock_print
def test_cv_send_params(self):
# done with app as a hack, fix this when more time
app, mp = self.build_up() # type: amp_gui.ElectroChemGUI
for call in mp.mock_calls:
print(call)
app.cv.device.send_cv_parameters()
app.cv.settings.use_svw = True
with mock.patch('builtins.print') as test_printer:
# app.cv.run_button.invoke()
app.cv.device.send_cv_parameters()
print('=======')
for call in test_printer.mock_calls:
print(call)
if __name__ == "__main__":
unittest.main()