18: tests, fixes

This commit is contained in:
Dobromir Popov
2025-08-05 14:11:49 +03:00
parent 71442f766c
commit 622d059aae
24 changed files with 1959 additions and 1638 deletions

45
COBY/simple_config.py Normal file
View File

@ -0,0 +1,45 @@
"""
Simple configuration for COBY system.
"""
import os
from dataclasses import dataclass
@dataclass
class APIConfig:
"""API configuration"""
host: str = "0.0.0.0"
port: int = 8080
websocket_port: int = 8081
cors_origins: list = None
rate_limit: int = 100
def __post_init__(self):
if self.cors_origins is None:
self.cors_origins = ["*"]
@dataclass
class LoggingConfig:
"""Logging configuration"""
level: str = "INFO"
file_path: str = "logs/coby.log"
@dataclass
class Config:
"""Main configuration"""
api: APIConfig = None
logging: LoggingConfig = None
debug: bool = False
def __post_init__(self):
if self.api is None:
self.api = APIConfig()
if self.logging is None:
self.logging = LoggingConfig()
# Global config instance
config = Config()