Projet de remplacement du "RPiPasserelle" d'Otec.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python3
  2. import pytest
  3. from starlette.testclient import TestClient
  4. from pyheatpump.variables import app, get_variables, set_variables, ROUTES
  5. def test_get_(set_test_db):
  6. c = TestClient(app)
  7. r = c.get('/')
  8. assert r.status_code == 200
  9. d_resp = r.json()
  10. assert type(d_resp) is dict
  11. assert 'A' in d_resp.keys()
  12. print(d_resp)
  13. assert '10' in d_resp['A'].keys()
  14. assert len(d_resp['A'].keys()) == 8
  15. assert len(d_resp['I'].keys()) == 3
  16. assert len(d_resp['D'].keys()) == 5
  17. @pytest.mark.skip
  18. def test_set_(set_test_db):
  19. c = TestClient(app)
  20. r = c.post('/')
  21. assert r.status_code == 200