File size: 528 Bytes
2e818da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import logging
import os

os.environ.setdefault("CEREBRAS_API_KEY", "test-key")
from app.websockets import handlers


def test_pair_buddy_turn_phase_log_has_safe_timing_fields(caplog):
    with caplog.at_level(logging.INFO, logger=handlers.__name__):
        handlers._log_pair_buddy_turn_phase(
            "1234567890abcdef",
            "context_ready",
            10.0,
            now=10.125,
        )

    assert caplog.messages == [
        "[PAIR_BUDDY] turn phase=context_ready project=12345678 elapsed_ms=125"
    ]