Last active
August 8, 2019 05:39
-
-
Save peterjpxie/fa42c7837f031f5be42d9b622def2a51 to your computer and use it in GitHub Desktop.
test_mock_service
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
import requests | |
def test_mock_service(): | |
url = 'http://127.0.0.1:5000/json' | |
resp = requests.get(url) | |
assert resp.status_code == 200 | |
assert resp.json()["code"] == 1 | |
print(resp.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment