Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide (fully covered) integration tests for all client methods #250

Open
20 of 34 tasks
jsamoocha opened this issue Nov 11, 2022 · 2 comments
Open
20 of 34 tasks

Provide (fully covered) integration tests for all client methods #250

jsamoocha opened this issue Nov 11, 2022 · 2 comments

Comments

@jsamoocha
Copy link
Collaborator

jsamoocha commented Nov 11, 2022

For effective CI and PR merging, all existing client endpoint tests from stravalib.tests.functional should be moved to or re-recreated in stravalib.tests.integration, and use the new mock_strava_api fixture to be independent of an actual connection to the Strava API. The tests in stravalib.tests.integration.test_client serve as examples.

For each test, let's try to cover all branching logic (and maybe use automated coverage tooling for that?)

The current swagger.json defines the following endpoints that need to be tested:

  • /athletes/{id}/stats (GET)
  • /athlete (GET)
  • /athlete (PUT)
  • /athlete/zones (GET)
  • /segments/{id} (GET)
  • /segments/starred (GET)
  • /segments/{id}/starred (PUT) - NOT IMPLEMENTED AT ALL
  • /segment_efforts (GET)
  • /segments/explore (GET)
  • /segment_efforts/{id} (GET)
  • /activities (POST)
  • /activities/{id} (GET)
  • /activities/{id} (PUT)
  • /athlete/activities (GET)
  • /activities/{id}/laps (GET)
  • /activities/{id}/zones (GET)
  • /activities/{id}/comments (GET)
  • /activities/{id}/kudos (GET)
  • /clubs/{id} (GET)
  • /clubs/{id}/members (GET)
  • /clubs/{id}/admins (GET)
  • /clubs/{id}/activities (GET)
  • /athlete/clubs (GET)
  • /gear/{id} (GET)
  • /routes/{id} (GET)
  • /athletes/{id}/routes (GET)
  • /routes/{id}/export_gpx (GET)
  • /routes/{id}/export_tcx (GET)
  • /uploads (POST)
  • /uploads/{uploadId} (GET)
  • /activities/{id}/streams (GET)
  • /segment_efforts/{id}/streams (GET)
  • /segments/{id}/streams (GET)
  • /routes/{id}/streams (GET)

This is quite a lot of work, so let's gradually add these tests in small PRs and check them off the list above.

@jsamoocha
Copy link
Collaborator Author

jsamoocha commented Nov 15, 2022

#256 takes care of /uploads, /activities{id} (GET), and /athlete (GET).

@jsamoocha
Copy link
Collaborator Author

Oops, I forgot to take into account multiple HTTP methods per endpoint, so added these to the checklist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant