fix: Resolve import issues and test compatibility
Some checks reported errors
continuous-integration/drone/push Build was killed

- Fix Storage class reference in authentication tests
- Add secret_key parameter to AgentAuthentication initialization
- Fix timedelta import in sessions.py
- Basic authentication functionality verified
This commit is contained in:
2025-11-25 21:33:17 +09:00
parent d00fc9fd61
commit 9f2cc216d5
10 changed files with 3510 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ from unittest.mock import Mock, patch, MagicMock
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../src'))
from auth import AgentAuthentication
from storage import Database
from storage import Storage
class TestAgentAuthentication(unittest.TestCase):
@@ -28,10 +28,11 @@ class TestAgentAuthentication(unittest.TestCase):
"""Set up test fixtures."""
self.temp_dir = tempfile.mkdtemp()
self.db_path = os.path.join(self.temp_dir, 'test_guardian.db')
self.auth = AgentAuthentication()
self.test_secret = 'test_secret_key_123'
self.auth = AgentAuthentication(self.test_secret)
# Create test database
self.db = Database(self.db_path)
self.db = Storage(self.db_path)
self.db.create_tables()
def tearDown(self):
@@ -245,7 +246,7 @@ class TestDatabase(unittest.TestCase):
"""Set up test fixtures."""
self.temp_dir = tempfile.mkdtemp()
self.db_path = os.path.join(self.temp_dir, 'test_guardian.db')
self.db = Database(self.db_path)
self.db = Storage(self.db_path)
self.db.create_tables()
def tearDown(self):