-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_football_api_wrapper.py
More file actions
30 lines (23 loc) · 1.01 KB
/
test_football_api_wrapper.py
File metadata and controls
30 lines (23 loc) · 1.01 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
#! usr/bin/python
import unittest
from football_api_wrapper import FootballAPIWrapper
class TestFootballAPIWrapper(unittest.TestCase):
def setUp(self):
self.faw = FootballAPIWrapper()
self.faw.api_key = ''
self.data_dir = '/data/'
@unittest.skip("To do")
def test_get_beginning_year(self):
pass
def test_unplayed_matches_tuple(self):
from datetime import datetime
matches = self.faw.unplayed_matches
for m in matches:
self.assertTrue(datetime.strptime(m.date, "%d.%m.%Y").date() >= datetime.now().date(),
"All the matches dates should be IN THE FUTURE compared to today")
def test_played_matches_tuple(self):
from datetime import datetime
matches = self.faw.played_matches
for m in matches:
self.assertTrue(datetime.strptime(m.date, "%d.%m.%Y").date() <= datetime.now().date(),
"All the matches dates should be IN THE PAST compared to today")