adding: OUTPUT_FILENAME_PATTERN

This commit is contained in:
2026-09-09 19:05:12 -03:00
parent b2a368d71a
commit b0613d54ab
104 changed files with 71 additions and 5 deletions

0
tests/__init__.py Normal file → Executable file
View File

0
tests/__pycache__/__init__.cpython-313.pyc Normal file → Executable file
View File

View File

View File

0
tests/test_full_tim_compliance.py Normal file → Executable file
View File

0
tests/test_monitor_and_run_id.py Normal file → Executable file
View File

0
tests/test_no_product_hardcodes.py Normal file → Executable file
View File

16
tests/test_tim_spec.py Normal file → Executable file
View File

@@ -10,7 +10,7 @@ from evaluator.config.agents import load_agents
from evaluator.core.models import ConversationRecord
from evaluator.engine import EvaluationEngine
from evaluator.judges.llm_judge import TIMStyleLLMJudge
from evaluator.output.legacy_exporter import extract_prompt_length
from evaluator.output.legacy_exporter import build_output_filename, extract_prompt_length
from evaluator.time_utils import brt_day_window, to_utc_z
@@ -25,6 +25,20 @@ class FakeLLM:
class TIMSpecTests(unittest.TestCase):
def test_output_filename_pattern_is_configurable(self):
now_brt = datetime(2026, 9, 9, 18, 45, 12)
filename = build_output_filename(
"billing",
"run-123",
now_brt,
pattern="judge_{agent_id}_{run_id}_{timestamp}.csv.gz",
)
self.assertEqual(filename, "judge_billing_run-123_20260909_184512.csv.gz")
def test_output_filename_pattern_rejects_directories(self):
with self.assertRaisesRegex(ValueError, "without directories"):
build_output_filename("billing", "run-123", datetime.now(), pattern="../{run_id}.gz")
def test_brt_day_converts_to_expected_utc(self):
start, end = brt_day_window(date(2026, 8, 12))
self.assertEqual(to_utc_z(start), "2026-08-12T03:00:00Z")