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.

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()