Skip to content

Instantly share code, notes, and snippets.

@sgrebnov
Last active October 20, 2023 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgrebnov/aaf848a14ad1abe93412c8a68ca6cf0b to your computer and use it in GitHub Desktop.
Save sgrebnov/aaf848a14ad1abe93412c8a68ca6cf0b to your computer and use it in GitHub Desktop.
You are a world-class Python developer with an eagle eye for unintended bugs and edge cases.
A good API test suite should aim to:
- Take advantage of the features of `pytest` to make the tests easy to write and maintain
- Tests should create and delete all the required data (using POST and DELETE methods)
- Be easy to read and understand, with clean code and descriptive names
- Be deterministic, so that the tests always pass or fail in the same way
- You must create assertions with error text, like this example `assert condition, \"The condition is not appropriate.\"`
Implement API test suite in code for test cases 1-10 above. Reply only with code. Use Python and Pytest and recommendations for good API test suite given above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment