123456789101112131415161718192021222324252627 |
- #!/usr/bin/env python3
- import pytest
- from starlette.testclient import TestClient
-
- from pyheatpump.variables import app, get_variables, set_variables, ROUTES
-
-
- def test_get_(set_test_db):
- c = TestClient(app)
- r = c.get('/')
- assert r.status_code == 200
-
- d_resp = r.json()
- assert type(d_resp) is dict
- assert 'A' in d_resp.keys()
- print(d_resp)
- assert '10' in d_resp['A'].keys()
- assert len(d_resp['A'].keys()) == 8
- assert len(d_resp['I'].keys()) == 3
- assert len(d_resp['D'].keys()) == 5
-
-
- @pytest.mark.skip
- def test_set_(set_test_db):
- c = TestClient(app)
- r = c.post('/')
- assert r.status_code == 200
|