diff --git a/tests/conftest.py b/tests/conftest.py index 038acb7..b80bf01 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -15,7 +15,7 @@ def set_test_db(): _, tmpdb = mkstemp(suffix='.db', dir=os.getcwd(), ) print(f'Will store database in {tmpdb}') config['heatpump']['database'] = tmpdb - assert DB.initialize(os.path.join(os.getcwd(), 'db/pyheatpump.sql')) + assert DB.initialize(os.path.join(os.getcwd(), './db/pyheatpump.sql')) DB.sqlf(os.path.join(os.getcwd(), 'db/test_variables.sql')) @@ -31,7 +31,7 @@ def set_test_db(): @pytest.fixture(scope="module") def set_db_values(): _, tmpdb = mkstemp(suffix='.db', dir=os.getcwd(), ) - db_file = "./db/prod-b827ebbcab83-20201206.db" + db_file = "./db/pyheatpump.db" shutil.copy(db_file, tmpdb) config['heatpump']['database'] = tmpdb diff --git a/tests/models/test_variable_value.py b/tests/models/test_variable_value.py index 7e9e009..853460f 100644 --- a/tests/models/test_variable_value.py +++ b/tests/models/test_variable_value.py @@ -31,14 +31,14 @@ def test_var_value_getval(set_test_db, var_types): continue time = datetime.fromtimestamp(variable.last_update) - value = VariableValue.get(variable.type, + value = VariableValue.get(var_type, variable.address, time).get_value() assert type(value) == float except StopIteration: assert False - + """ var_type = var_types['Integer'] for _, variable in var_type.get_variables().items(): try: @@ -46,14 +46,13 @@ def test_var_value_getval(set_test_db, var_types): continue time = datetime.fromtimestamp(variable.last_update) - value = VariableValue.get(variable.type, + value = VariableValue.get(var_type, variable.address, time).get_value() assert type(value) == int except StopIteration: assert False - var_type = var_types['Digital'] for _, variable in var_type.get_variables().items(): try: @@ -61,10 +60,11 @@ def test_var_value_getval(set_test_db, var_types): continue time = datetime.fromtimestamp(variable.last_update) - value = VariableValue.get(variable.type, + value = VariableValue.get(var_type, variable.address, time).get_value() assert type(value) == bool except StopIteration: assert False + """