/
Chaizee
/
ZenithCode_Incident-LLM-analytics
Обзор
Документация
Войти
/
Chaizee
/
ZenithCode_Incident-LLM-analytics
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
tests/test_features.py
30 строк
870 B
Chaizee
feat: new realisation
11 июн 2026, 19:58
11 июн 2026, 19:58
697b236
Код
Авторство
О чём код?
def test_detect_anomalies_spike(): import pandas as pd from src.anomalies import detect_anomalies dates = pd.date_range("2025-01-01", periods=40, freq="D") rows = [] for d in dates[:-3]: rows.append( { "creation_dt": d, "municipality": "Омск", "category": "ЖКХ", "is_problem": True, } ) for d in dates[-3:]: for _ in range(10): rows.append( { "creation_dt": d, "municipality": "Омск", "category": "ЖКХ", "is_problem": True, } ) df = pd.DataFrame(rows) alerts = detect_anomalies(df, recent_days=3, min_recent=5) assert alerts assert "ЖКХ" in alerts[0]["message"]