mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-04-19 08:55:15 +00:00
Adapt tests to package directory structure.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
parent
7d25194585
commit
9f78966c89
7
Makefile
7
Makefile
@ -1,5 +1,5 @@
|
|||||||
# Define the targets
|
# Define the targets
|
||||||
.PHONY: help venv pip docker-run docs clean
|
.PHONY: help venv pip test docker-run docs clean
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
all: help
|
all: help
|
||||||
@ -38,6 +38,11 @@ run:
|
|||||||
@echo "Starting flask server, please wait..."
|
@echo "Starting flask server, please wait..."
|
||||||
.venv/bin/python ./flask_server.py
|
.venv/bin/python ./flask_server.py
|
||||||
|
|
||||||
|
# Target to run tests.
|
||||||
|
test:
|
||||||
|
@echo "Running tests..."
|
||||||
|
.venv/bin/pytest
|
||||||
|
|
||||||
# Run entire setup on docker
|
# Run entire setup on docker
|
||||||
docker-run:
|
docker-run:
|
||||||
@docker compose up
|
@docker compose up
|
||||||
|
@ -5,3 +5,10 @@ profile = "black"
|
|||||||
ignore = [
|
ignore = [
|
||||||
"F841", # don't complain about unused variables
|
"F841", # don't complain about unused variables
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
minversion = "7.0"
|
||||||
|
addopts = "--cov=src"
|
||||||
|
pythonpath = [ "src", ]
|
||||||
|
testpaths = [ "tests", ]
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from modules.class_akku import PVAkku
|
from akkudoktoreos.class_akku import PVAkku
|
||||||
|
|
||||||
|
|
||||||
class TestPVAkku(unittest.TestCase):
|
class TestPVAkku(unittest.TestCase):
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from modules.class_akku import PVAkku
|
from akkudoktoreos.class_akku import PVAkku
|
||||||
from modules.class_ems import EnergieManagementSystem
|
from akkudoktoreos.class_ems import EnergieManagementSystem
|
||||||
from modules.class_haushaltsgeraet import Haushaltsgeraet
|
from akkudoktoreos.class_haushaltsgeraet import Haushaltsgeraet
|
||||||
from modules.class_inverter import Wechselrichter # Example import
|
from akkudoktoreos.class_inverter import Wechselrichter # Example import
|
||||||
|
|
||||||
prediction_hours = 48
|
prediction_hours = 48
|
||||||
optimization_hours = 24
|
optimization_hours = 24
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from modules.class_optimize import optimization_problem
|
from akkudoktoreos.class_optimize import optimization_problem
|
||||||
|
|
||||||
# Sample known result (replace with the actual expected output)
|
# Sample known result (replace with the actual expected output)
|
||||||
EXPECTED_RESULT = {
|
EXPECTED_RESULT = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from modules.heatpump import Heatpump
|
from akkudoktoreos.heatpump import Heatpump
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user