Skip to content

Instantly share code, notes, and snippets.

@peterjpxie
Last active August 8, 2019 05:39
Show Gist options
  • Save peterjpxie/fa42c7837f031f5be42d9b622def2a51 to your computer and use it in GitHub Desktop.
Save peterjpxie/fa42c7837f031f5be42d9b622def2a51 to your computer and use it in GitHub Desktop.
test_mock_service
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