Check that repost is fine
This commit is contained in:
parent
5b25c9aea7
commit
c5510678f9
|
@ -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"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue