> For the complete documentation index, see [llms.txt](https://ultimatewebsolutions.gitbook.io/qa-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ultimatewebsolutions.gitbook.io/qa-knowledge-base/api-testing-with-python/write-a-python-test-for-this-rest-endpoint.md).

# Write a Python test for this REST endpoint

You should be comfortable writing something like:

```python
import pytest
import requests


def test_get_user():
    response = requests.get(
        "https://api.example.com/users/123",
        timeout=10
    )

    assert response.status_code == 200

    data = response.json()

    assert data["id"] == 123
    assert "name" in data
```
