forked from nss-day-cohort-13/birdyboard-castle-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestBoard.py
67 lines (47 loc) · 2.05 KB
/
testBoard.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import unittest
from board import *
import uuid
class TestBoard(unittest.TestCase):
# http://i.imgur.com/lZ0bxod.gifv <--- uber lolz
@classmethod
def setUp(self):
self.board = Board()
self.TestBoard = TestBoard()
self.user
self.convo = {}
self.chirp = {}
self.uid = str(uuid.uuid4())
self.test_username = "roor"
self.test_fullname = "castle"
self.test_chirp = "hi"
self.test_private = False
self.test_recipient = None
def userCreation(self, inp1, inp2):
# tests to make sure user object has username and fullname keys and values
self.user[self.uid] = dict()
testUN = self.user[self.uid]['username'] = inp1
testFN = self.user[self.uid]['fullname'] = inp2
return testUN, testFN
def test_testUserCreation(self):
self.assertEqual(self.TestBoard.userCreation(self.test_username, self.test_fullname), ('roor', 'castle'))
# tests to make sure user object has username and fullname keys and values
def chirpCreation(self, inp1, inp2, inp3):
#tests to make sure the chirp object has chirp(message), private, recipient keys and values
self.chirp[self.uid] = dict()
testChirp = self.chirp[self.uid]['chirp'] = inp1
testPrivate = self.chirp[self.uid]['private'] = inp2
testRecipient = self.chirp[self.uid]['recipient'] = inp3
return testChirp, testPrivate, testRecipient
def test_testChirpCreation(self):
self.assertEqual(self.TestBoard.chirpCreation(self.test_chirp, self.test_private, self.test_recipient), ('hi', False, None))
#tests to make sure the chirp object has chirp(message), private, recipient keys and values
def convoCreation(self, inp1):
# tests to make sure convo object has convoname and fullname keys and values
self.convo[self.uid] = dict()
testID = self.convo[self.uid]['convoname'] = [chirpID]
return testUN, testFN
def test_testconvoCreation(self):
self.assertEqual(self.TestBoard.convoCreation(self.test_convoname, self.test_fullname), ('roor', 'castle'))
# tests to make sure us
if __name__ == '__main__':
unittest.main()