initial commit
This commit is contained in:
4
tests/data/input/sample_data_example.json
Normal file
4
tests/data/input/sample_data_example.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"tokens": [
|
||||
]
|
||||
}
|
||||
37
tests/test_athletico.py
Normal file
37
tests/test_athletico.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from athleticotogo.athletico import Athletico
|
||||
import unittest
|
||||
import vcr
|
||||
import os
|
||||
import json
|
||||
|
||||
|
||||
class TestAthletico(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None:
|
||||
with open('tests/data/input/sample_data.json') as f:
|
||||
cls.tokens = json.load(f)['tokens']
|
||||
|
||||
def setUp(self):
|
||||
os.chdir("..")
|
||||
pass
|
||||
|
||||
@vcr.use_cassette(cassette_library_dir="tests/fixtures")
|
||||
def test_extract(self):
|
||||
a = Athletico()
|
||||
episodes = a.fetch_episodes_for_access_code(self.tokens[0])
|
||||
self.assertIn('id', episodes[0])
|
||||
self.assertIn('program', episodes[0])
|
||||
self.assertIn('program_exercises', episodes[0]['program'])
|
||||
|
||||
@vcr.use_cassette(cassette_library_dir="tests/fixtures")
|
||||
def test_save_extraction_to_local(self):
|
||||
a = Athletico()
|
||||
for token in self.tokens:
|
||||
episodes = a.fetch_episodes_for_access_code(token)
|
||||
a.save_episodes(episodes, destination='tests/data/output')
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user