add tests

This commit is contained in:
2022-06-25 09:10:44 -05:00
parent 8a1ad6bb7e
commit f8d70754ee
2 changed files with 29 additions and 1395 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -10,13 +10,13 @@ from os import getenv
import vcr
vcr_options = dict(
cassette_library_dir = "fixtures/vcr_cassettes/",
ignore_localhost=True,
filter_post_data_parameters=['email', 'password'],
# record_mode="new_episodes",
decode_compressed_response=True,
# allow_playback_repeats=True,
)
cassette_library_dir = "fixtures/vcr_cassettes/",
ignore_localhost=True,
filter_post_data_parameters=['email', 'password'],
# record_mode="new_episodes",
decode_compressed_response=True,
# allow_playback_repeats=True,
)
class TestGamescrapyr(unittest.TestCase):
"""Tests for `gamescrapyr` package."""
@@ -183,3 +183,25 @@ class TestGamescrapyr(unittest.TestCase):
should_be_authorized = self.client.is_authorized()
self.assertTrue(should_be_authorized)
self.client
@vcr.use_cassette(**vcr_options)
def test_006_test_teams(self):
kwargs = {
'season_slug': self.season_slug,
'team_id': self.team_id,
'team_slug': self.team_slug
}
teams = self.client.get_teams()
self.assertIsInstance(teams, list)
keys = ['name',
'id',
'season' ,
'season_slug',
'team_slug'
]
for d in teams:
for key in keys:
self.assertIn(key, d.keys())
self.assertNotEqual('', d.get(key))