-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
71 lines (59 loc) · 1.88 KB
/
Copy pathtests.py
File metadata and controls
71 lines (59 loc) · 1.88 KB
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
68
69
70
71
import unittest
import credentials
from opis import (
authenticate, getzipcoderesults, getlatlongresults,
getzipcodesortedresults, getlatlongsortedresults,
getcitystatesortedresults, getlatlongsortedwithdistanceresults
)
class TestOpisMethods(unittest.TestCase):
def setUp(self):
self.customer_token = credentials.CUSTOMER_TOKEN
self.user_ticket = authenticate(self.customer_token)
self.city = "Los Angeles"
self.state = "CA"
self.sort_product = "Unleaded"
self.lat = "34.040310"
self.long = "-118.232804"
self.distance = "10"
self.filter_distance = "False"
self.user_lat = "34.040310"
self.user_long = "-118.232804"
self.zip = "90048"
def test_authenticate(self):
self.assertTrue(self.user_ticket)
def test_getcitystatesortedresults(self):
output = getcitystatesortedresults(
self.user_ticket, self.city, self.state, self.sort_product
)
print(output, "\n")
self.assertTrue(output)
def test_getlatlongresults(self):
output = getlatlongresults(self.user_ticket, self.lat, self.long)
print(output, "\n")
self.assertTrue(output)
def test_getlatlongsortedresults(self):
output = getlatlongsortedresults(
self.user_ticket, self.lat, self.long, self.sort_product
)
print(output, "\n")
self.assertTrue(output)
def test_getlatlongsortedwithdistanceresults(self):
output = getlatlongsortedwithdistanceresults(
self.user_ticket, self.lat, self.long, self.sort_product,
self.distance, self.filter_distance,
self.user_lat, self.user_long
)
print(output, "\n")
self.assertTrue(output)
def test_getzipcoderesults(self):
output = getzipcoderesults(self.user_ticket, self.zip)
print(output, "\n")
self.assertTrue(output)
def test_getzipcodesortedresults(self):
output = getzipcodesortedresults(
self.user_ticket, self.zip, self.sort_product
)
print(output, "\n")
self.assertTrue(output)
if __name__ == '__main__':
unittest.main()