-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
36 lines (28 loc) · 892 Bytes
/
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
import unittest
import cli
from location.scoring import StumbleScore
class CLITestCase(unittest.TestCase):
def setUp(self):
self.location = StumbleScore(19078)
self.location.search()
def test_cli_welcome(self):
r = cli.cli('test')
self.assertIn('Welcome to StumbleScore', r)
def test_cli_address(self):
r = cli.cli(19078, 2)
self.assertIn('19078', r)
def test_cli_geocode(self):
r = cli.cli(19078, 2)
self.assertIn('-75.32', r)
self.assertIn('39.8', r)
def test_bar_count(self):
r = self.location.bar_count()
self.assertEqual(r, 20)
def test_score(self):
r = self.location.score()
self.assertEqual(r, 100.0)
def test_category(self):
r = self.location.category()
self.assertEqual(r, 'Wet')
if __name__ == '__main__':
unittest.main()