-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_unittest.py
34 lines (31 loc) · 1.28 KB
/
app_unittest.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
import os
import sys
sys.path.append(os.path.realpath('..'))
from app import *
#--------------------------------------------------------------------------------------------------------------------------------
# COMMENTS:
#
# 1) Basic testing setup; this is a basic setup does NOT focus on covering all cases,
# it is only meant to serve as a tool to demonstrate how (unit)testing would work with
# something like this app.
#--------------------------------------------------------------------------------------------------------------------------------
class TestAppMethods(unittest.TestCase):
def test_get_SnapTravel_rates(self, city = 'city_string_input', checkin = 'checkin_string_input', checkout = 'checkout_string_input'):
return self.assertNotEqual(
first = get_SnapTravel_rates(
city = city,
checkin = checkin,
checkout = checkout
),
second = None,
msg = "API call should return some data!"
)
# def test_get_data(self):
# def test_get_common_data():
# def test_get_and_cache_data():
# def test_cache_data():
# def test_requests_on_submit_concurrent():
# def test_get_Hotelscom_rates():
if __name__ == '__main__':
unittest.main()