add test of adding sonde
This commit is contained in:
parent
ab5d69e44d
commit
546733d998
|
@ -5,6 +5,8 @@ from fastapi import FastAPI
|
|||
|
||||
app = FastAPI()
|
||||
|
||||
sondes = []
|
||||
|
||||
|
||||
class Sonde(BaseModel):
|
||||
identifiant: str
|
||||
|
|
|
@ -3,6 +3,8 @@ from fastapi.testclient import TestClient
|
|||
|
||||
from papi.main import app
|
||||
|
||||
from papi.main import sondes
|
||||
|
||||
from papi import __version__
|
||||
|
||||
client = TestClient(app)
|
||||
|
@ -22,3 +24,4 @@ def test_creer_sonde():
|
|||
sonde1 = {"identifiant": "masonde_001", "nom": "client1"}
|
||||
response = client.post("/sonde/", json=sonde1)
|
||||
assert response.status_code == 200
|
||||
assert sonde1 in sondes
|
||||
|
|
Loading…
Reference in New Issue