Auto-fixed categories: - F401: unused imports removed - I001: import blocks sorted - W293: trailing whitespace stripped - UP035: deprecated typing imports replaced - SIM: simplify suggestions applied - ARG: unused args prefixed with underscore - T201: print statements removed - F841: unused variables removed - RUF059: unpacked variables prefixed Remaining ~1500 unfixable errors (C901, B904, N806, E402) require manual work. Backend smoke tests: 13/13 passed.
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
# #region test_models [TYPE Module] [C:1] [SEMANTICS test, model, sqlalchemy, unit]
|
|
# @BRIEF Unit tests for data models
|
|
# @LAYER: Domain
|
|
# @RELATION VERIFIES -> [ModelsPackage]
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add src to path
|
|
sys.path.append(str(Path(__file__).parent.parent.parent.parent / "src"))
|
|
from src.core.config_models import Environment
|
|
from src.core.logger import belief_scope
|
|
|
|
|
|
# #region test_environment_model [TYPE Function]
|
|
# @RELATION BINDS_TO -> test_models
|
|
# @BRIEF Tests that Environment model correctly stores values.
|
|
# @PRE: Environment class is available.
|
|
# @POST: Values are verified.
|
|
def test_environment_model():
|
|
with belief_scope("test_environment_model"):
|
|
env = Environment(
|
|
id="test-id",
|
|
name="test-env",
|
|
url="http://localhost:8088/api/v1",
|
|
username="admin",
|
|
password="password",
|
|
)
|
|
assert env.id == "test-id"
|
|
assert env.name == "test-env"
|
|
assert env.url == "http://localhost:8088/api/v1"
|
|
# #endregion test_environment_model
|
|
# #endregion test_models
|