Projet de remplacement du "RPiPasserelle" d'Otec.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

test_variable.py 649B

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()) == 4
  15. assert len(d_resp['I'].keys()) == 4
  16. assert len(d_resp['D'].keys()) == 4
  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