-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.py
36 lines (25 loc) · 1.33 KB
/
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 json
import unittest
import sample_test_results
from core import stats
class DjangoTestCases(unittest.TestCase):
def test_lost_stats(self):
self.lost_count_at_places = stats.lost_stats()
self.assertNotEqual(self.lost_count_at_places, 0)
self.assertNotEqual(self.lost_count_at_places, None)
self.assertEqual(str(type(self.lost_count_at_places)), "<class 'dict'>")
self.assertEqual(self.lost_count_at_places, sample_test_results.SAMPLE_TEST_LOST_STATS_RESULTS)
def test_found_stats(self):
self.found_count_at_places = stats.found_stats()
self.assertNotEqual(self.found_count_at_places, 0)
self.assertNotEqual(self.found_count_at_places, None)
self.assertEqual(str(type(self.found_count_at_places)), "<class 'dict'>")
self.assertEqual(self.found_count_at_places, sample_test_results.SAMPLE_TEST_FOUND_STATS_RESULTS)
def test_lost_and_found_relation(self):
self.relation_dict = stats.lost_and_found_relation()
self.assertNotEqual(self.relation_dict, 0)
self.assertNotEqual(self.relation_dict, None)
self.assertEqual(str(type(self.relation_dict)), "<class 'dict'>")
self.assertEqual(self.relation_dict, sample_test_results.SAMPLE_TEST_LOST_AND_FOUND_RELATION)
if __name__ == '__main__':
unittest.main()