Last active
May 30, 2017 16:46
-
-
Save paulgoetze/dd7c17d6943bf828a10e8a9b165d07c0 to your computer and use it in GitHub Desktop.
Testing Your Python API App with JSON Schema - tests/test_users.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tests/test_users.py | |
import json | |
from .support.assertions import assert_valid_schema | |
def test_get_user(client): | |
# Do whatever is necessary to create a user here… | |
response = client.get('/users/1') | |
json_data = json.loads(response.data) | |
assert_valid_schema(json_data, 'user.json') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment