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

Cli tests for add user and ls #199

Merged
merged 11 commits into from
Nov 25, 2021
Merged

Conversation

alneberg
Copy link
Contributor

Running tests independently of the API where all http requests are mocked and return values are explicitly set in the test files. This will of course need to be updated when we change the API. The isolation of the cli in the tests can also be seen as a benefit since it's much easier to debug when something goes wrong.

The mocking is done in pytest fixtures and the actual commands are triggered with the utilities for testing supplied with click. To keep the mocking flexible where the return values can be modified between tests, the fixtures return a function that in turn returns a mock when called. When calling this method, the mock can be customised.

Tests for other commands will come along the way.

@alneberg alneberg requested a review from i-oden November 25, 2021 09:29
@alneberg
Copy link
Contributor Author

Test runs in github actions! 🎉
Screenshot 2021-11-25 at 10 30 37

@i-oden i-oden added must have Cannot deliver on target date without this tests labels Nov 25, 2021
@i-oden i-oden merged commit 6005729 into ScilifelabDataCentre:dev Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
must have Cannot deliver on target date without this tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants