Spaces:
Running
Running
File size: 1,859 Bytes
fd1472e 627c291 fd1472e 627c291 fd1472e 627c291 fd1472e 627c291 fd1472e 627c291 fd1472e 627c291 fd1472e 627c291 fd1472e 627c291 fd1472e 599a754 fd1472e 627c291 fd1472e 627c291 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
"""Tests for domain configuration."""
from src.config.domain import (
SEXUAL_HEALTH_CONFIG,
ResearchDomain,
get_domain_config,
)
class TestResearchDomain:
def test_enum_values(self):
# DeepBoner only supports sexual health
assert ResearchDomain.SEXUAL_HEALTH.value == "sexual_health"
assert len(ResearchDomain) == 1
class TestGetDomainConfig:
def test_default_returns_sexual_health(self):
config = get_domain_config()
assert config.name == "Sexual Health Research"
def test_explicit_sexual_health(self):
config = get_domain_config(ResearchDomain.SEXUAL_HEALTH)
assert "Sexual Health" in config.report_title
assert "sexual health" in config.judge_system_prompt.lower()
def test_accepts_string(self):
config = get_domain_config("sexual_health")
assert "Sexual Health" in config.name
def test_invalid_string_raises_value_error(self):
# Invalid domains should fail fast with clear error
import pytest
with pytest.raises(ValueError) as exc_info:
get_domain_config("invalid_domain")
assert "Invalid domain" in str(exc_info.value)
assert "sexual_health" in str(exc_info.value) # Shows valid options
def test_config_has_required_fields(self):
required_fields = [
"name",
"report_title",
"judge_system_prompt",
"hypothesis_system_prompt",
"report_system_prompt",
]
config = get_domain_config(ResearchDomain.SEXUAL_HEALTH)
for field in required_fields:
assert getattr(config, field), f"SEXUAL_HEALTH missing {field}"
def test_sexual_health_config_exported(self):
# Verify the config constant is exported
assert SEXUAL_HEALTH_CONFIG.name == "Sexual Health Research"
|