File size: 448 Bytes
ba19a97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastapi.testclient import TestClient
from app.main import app

client = TestClient(app)

def test_register_user():
    response = client.post("/register", json={"username": "test", "password": "test"})
    assert response.status_code == 200

def test_read_users():
    response = client.get("/users/")
    assert response.status_code == 200

def test_read_user():
    response = client.get("/users/test")
    assert response.status_code == 200