1
0
mirror of https://gitlab.com/MisterBiggs/testing-framework-comparison.git synced 2025-06-15 17:06:39 +00:00
2025-05-17 14:05:07 -06:00

25 lines
566 B
Python

import requests
import pytest
def test_health_check():
assert requests.get("https://restful-booker.herokuapp.com/ping").status_code == 201
@pytest.fixture
def auth_token():
body = {"username": "admin", "password": "password123"}
resp = requests.post("https://restful-booker.herokuapp.com/auth", params=body)
resp.raise_for_status()
print(resp.text)
token = resp.json()["token"]
return token
@pytest.mark.xfail(reason="Default credentials don't work on the prod server")
def test_get_auth_token(auth_token):
assert auth_token