Test from scracth start of monitoring

This commit is contained in:
Colin Goutte 2021-09-27 16:06:25 +02:00
parent bd7ad825fe
commit b729983b2a
1 changed files with 17 additions and 0 deletions

View File

@ -73,6 +73,23 @@ def test_sample_report():
assert rjson[0] == "-1#Test channel error"
def test_historique():
id_sonde = "masonde_histo"
histo = {"identifiant": id_sonde, "nom": "Test historique"}
assert client.post("/sonde/", json=histo).ok
data = testutils.probe_sample_body(
channel_name="test_historique", channel_id=0, status="ok"
)
response = client.post(f"/sonde/{id_sonde}/", json=data)
assert response.ok
debut_supervision = client.get(f"/sonde/{id_sonde}/historique")
debut_supervision = debut_supervision.json()
assert len(debut_supervision) == 1
assert debut_supervision[0] == f"{data['date']} test_historique absent ok"
class CodeCoverageTestCase(TestCase):