forked from doboy/Assassinbility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils_test.py
49 lines (37 loc) · 1.19 KB
/
utils_test.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import os
import unittest
from mockito import when, verify, mock, unstub
from utils import *
class utilsTest(unittest.TestCase):
def tearDown(self):
unstub()
def testSendSMS(self):
to, body = mock(), mock()
when(client.sms.messages).create(
to=to,
from_=os.environ['TWILIO_NUMBER'],
body=body).thenReturn(None)
sendSMS(to, body)
verify(client.sms.messages).create(
to=to,
from_=os.environ['TWILIO_NUMBER'],
body=body)
def testSendSMSRules(self):
to = mock()
body = "the fuck broah. follow the rules"
when(client.sms.messages).create(
to=to,
from_=os.environ['TWILIO_NUMBER'],
body=body).thenReturn(None)
sendRulesSMS(to)
verify(client.sms.messages).create(
to=to,
from_=os.environ['TWILIO_NUMBER'],
body=body)
def testParseUsers(self):
Users = parseUsers('8,huan\n' '9,daniel')
self.assertEquals(len(Users), 2)
def testGetPartialCongrats(self):
self.assertIsInstance(getPartialCongrats(), str)
if __name__ == '__main__':
unittest.main()