Fix unit tests

This commit is contained in:
2025-08-31 21:46:14 +00:00
parent c76a77cb0c
commit 71d5b378d9
3 changed files with 87 additions and 35 deletions

View File

@@ -1,4 +1,5 @@
import unittest
from pathlib import Path
from src.models import Gate, Status
from src.repository import GatesRepository
@@ -6,7 +7,7 @@ from src.repository import GatesRepository
class TestGatesRepository(unittest.TestCase):
def setUp(self):
self.mock_json_path = "../resources/mock_gates.json"
self.mock_json_path = str(Path("./tests/resources/mock_gates.json").resolve())
self.repo = GatesRepository(self.mock_json_path)
def test_get_by_key_returns_gate_when_key_exists(self):
@@ -38,7 +39,6 @@ class TestGatesRepository(unittest.TestCase):
for gate in result:
self.assertTrue(gate.status == Status.ENABLED)
print(gate.status)
# New Test
def test_load_gates_handles_invalid_json_file_gracefully(self):