forked from jce-il/TDD-Kata-FindAPerson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindAPersonTests.py
34 lines (26 loc) · 1.32 KB
/
FindAPersonTests.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
import unittest
from CrowdMap import CrowdMap
class FindAPersonTests(unittest.TestCase):
def setUp(self):
postList = ["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley"]
self.crowdmap = CrowdMap(postList)
def test_getAllPostsForName(self):
posts = self.crowdmap.getAllPostsFor("Or")
self.assertEquals(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley"], posts)
def test_getAllPostsForNonExistantName(self):
posts = self.crowdmap.getAllPostsFor("Joe")
self.assertEquals([], posts)
def test_existingLocatinInformationReturnsTrue(self):
locationExist = self.crowdmap.isLocationForName("Or")
self.assertTrue(locationExist)
def test_nonExistingLocatinInformationReturnsFalse(self):
locationExist = self.crowdmap.isLocationForName("Lassy")
self.assertFalse(locationExist)
def test_mapInconsistenciesReturnsTrue(self):
mapIncosistent = self.crowdmap.mapInconsistenciesExist("Or")
self.assertTrue(mapIncosistent)
def test_mapIncosistenciesReturnsFalse(self):
mapIncosistent = self.crowdmap.mapInconsistenciesExist("Lassy")
self.assertFalse(mapIncosistent)
if __name__ == '__main__':
unittest.main()