Check that repost is fine

This commit is contained in:
Colin Goutte 2021-09-27 15:25:07 +02:00
parent 5b25c9aea7
commit c5510678f9
1 changed files with 21 additions and 0 deletions

View File

@ -50,3 +50,24 @@ def test_post_data():
assert response.json()["count"] == curlen + 1
def test_sample_report():
id_ = "masonde_001"
data = testutils.probe_sample_body()
response = client.post(f"/sonde/{id_}/", json=data)
assert response.status_code == 200
report = client.get(f"/sonde/{id_}/rapport")
rjson = report.json()
assert len(rjson) == 1
assert rjson[0] == "-1#Test channel ok"
data["channels"][0]["status"] = "error"
response = client.post(f"/sonde/{id_}/", json=data)
report = client.get(f"/sonde/{id_}/rapport")
rjson = report.json()
assert len(rjson) == 1
assert rjson[0] == "-1#Test channel error"