Projet de remplacement du "RPiPasserelle" d'Otec.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

conftest.py 753B

12345678910111213141516171819202122232425262728293031
  1. import os
  2. import pytest
  3. import sys
  4. from tempfile import mkstemp
  5. from pyheatpump import DB
  6. from pyheatpump.models import *
  7. from pyheatpump.config import config
  8. pytest_plugins = "pytester"
  9. @pytest.fixture(scope="module")
  10. def set_test_db():
  11. _, tmpdb = mkstemp(suffix='.db', dir=os.getcwd(), )
  12. print(f'Will store database in {tmpdb}')
  13. config['heatpump']['database'] = tmpdb
  14. assert DB.initialize(os.path.join(os.getcwd(), 'db/pyheatpump.sql'))
  15. DB.sqlf(os.path.join(os.getcwd(), 'db/test_variables.sql'))
  16. DB.sqlf(os.path.join(os.getcwd(), 'db/test_variable_values.sql'))
  17. DB.sqlf(os.path.join(os.getcwd(), 'db/test_variable_values_wo_time.sql'))
  18. yield
  19. @pytest.fixture
  20. def var_types():
  21. return VariableType.getall()