From 546733d9984ed8e2f82c7e973cdcc7990b437c20 Mon Sep 17 00:00:00 2001 From: Colin Goutte Date: Wed, 22 Sep 2021 11:29:58 +0200 Subject: [PATCH] add test of adding sonde --- papi/main.py | 2 ++ tests/test_papi.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/papi/main.py b/papi/main.py index 028ad74..83013ef 100644 --- a/papi/main.py +++ b/papi/main.py @@ -5,6 +5,8 @@ from fastapi import FastAPI app = FastAPI() +sondes = [] + class Sonde(BaseModel): identifiant: str diff --git a/tests/test_papi.py b/tests/test_papi.py index 255afd5..6505835 100644 --- a/tests/test_papi.py +++ b/tests/test_papi.py @@ -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