-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtimeTests.py
More file actions
54 lines (49 loc) · 1.58 KB
/
timeTests.py
File metadata and controls
54 lines (49 loc) · 1.58 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import unittest
from kivy.uix.button import Button
from kivy.uix.popup import Popup
from controller import MyClockApp
class dismisssleepTestCase(unittest.TestCase):
def setUp(self):
from controller import SetAlarmPopup
def test_alarmHour(self):
from controller import SetAlarmPopup
from model import alarmModel
myAlarm = alarmModel()
alarm = SetAlarmPopup()
four = Button(text = '04')
fortyFive = Button(text = '45')
alarmPopup = Popup()
alarm.dismissAlarmPopup(alarmPopup, four, fortyFive, 0)
self.assertEqual(myAlarm.getWakeHour(), 4)
def test_alarmMin(self):
from controller import SetAlarmPopup
from model import alarmModel
myAlarm = alarmModel()
alarm = SetAlarmPopup()
four = Button(text = '04')
fortyFive = Button(text = '45')
alarmPopup = Popup()
alarm.dismissAlarmPopup(alarmPopup, four, fortyFive, 0)
self.assertEqual(myAlarm.getWakeMin(), 45)
def test_sleepHour(self):
from controller import SetSleepPopup
from model import alarmModel
myAlarm = alarmModel()
sleep = SetSleepPopup()
four = Button(text = '04')
fortyFive = Button(text = '45')
sleepPopup = Popup()
sleep.dismissSleepPopup(sleepPopup, four, fortyFive, 0)
self.assertEqual(myAlarm.getSleepHour(), 4)
def test_sleepMin(self):
from controller import SetSleepPopup
from model import alarmModel
myAlarm = alarmModel()
sleep = SetSleepPopup()
four = Button(text = '04')
fortyFive = Button(text = '45')
sleepPopup = Popup()
sleep.dismissSleepPopup(sleepPopup, four, fortyFive, 0)
self.assertEqual(myAlarm.getSleepMin(), 45)
if __name__ == '__main__':
unittest.main()