forked from jce-il/TDD-Kata-FindAPerson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindPersonTests.py
28 lines (22 loc) · 952 Bytes
/
FindPersonTests.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
import unittest
from Crowdmap import Crowdmap
class FindPersonTests(unittest.TestCase):
def setUp(self):
self.crowdmap = Crowdmap(["I met Or A. at Chabad house Bangkok",
"We found Or A. R.I.P at Langtang valley",
"MissingCowboy",
"Lassy Come Home"])
def test_getAllPostsForName(self):
posts = self.crowdmap.get_all_posts_for("Or")
self.assertEquals(posts, ["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley"])
def test_getAllPostForMissingName(self):
posts = self.crowdmap.get_all_posts_for("Joe")
self.assertEquals([], posts)
def test_existingLocationInformationReturnsTrue(self):
location_exist = self.crowdmap.is_location_for_name("Or")
self.assertTrue(location_exist)
def test_isMapConsistence(self):
consistence = self.crowdmap.is_map_consistence("Or")
self.assertTrue(consistence)
if __name__ == '__main__':
unittest.main()