aaron-schroeder / distilling-flask

Strava app for display and analysis of personal running data, powered by Flask, Dash, and Pandas.
MIT License
3 stars 0 forks source link

Testing idea: Record strava API responses to play back later #96

Open aaron-schroeder opened 1 year ago

aaron-schroeder commented 1 year ago
import unittest
from responses import _recorder

from distilling_flask import db
from distilling_flask.io_storages.strava.models import StravaImportStorage
from tests.unit_tests.io_storages.strava.base import LiveStravaApiFlaskTestCase

class TestCase(LiveStravaApiFlaskTestCase):
  @_recorder.record(file_path='out.yaml')
  def test_athlete_activities(self):
    storage = db.session.scalars(db.select(StravaImportStorage)).first()
    client = storage.get_client()
    client.get('/athlete/activities', per_page=200)  # page=1