add tests
This commit is contained in:
1388
tests/fixtures/vcr_cassettes/setUp
vendored
1388
tests/fixtures/vcr_cassettes/setUp
vendored
File diff suppressed because it is too large
Load Diff
@@ -10,13 +10,13 @@ from os import getenv
|
|||||||
import vcr
|
import vcr
|
||||||
|
|
||||||
vcr_options = dict(
|
vcr_options = dict(
|
||||||
cassette_library_dir = "fixtures/vcr_cassettes/",
|
cassette_library_dir = "fixtures/vcr_cassettes/",
|
||||||
ignore_localhost=True,
|
ignore_localhost=True,
|
||||||
filter_post_data_parameters=['email', 'password'],
|
filter_post_data_parameters=['email', 'password'],
|
||||||
# record_mode="new_episodes",
|
# record_mode="new_episodes",
|
||||||
decode_compressed_response=True,
|
decode_compressed_response=True,
|
||||||
# allow_playback_repeats=True,
|
# allow_playback_repeats=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
class TestGamescrapyr(unittest.TestCase):
|
class TestGamescrapyr(unittest.TestCase):
|
||||||
"""Tests for `gamescrapyr` package."""
|
"""Tests for `gamescrapyr` package."""
|
||||||
@@ -183,3 +183,25 @@ class TestGamescrapyr(unittest.TestCase):
|
|||||||
should_be_authorized = self.client.is_authorized()
|
should_be_authorized = self.client.is_authorized()
|
||||||
self.assertTrue(should_be_authorized)
|
self.assertTrue(should_be_authorized)
|
||||||
self.client
|
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))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user