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

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