test: фаза 4 — тесты extractors, ecosystem, i18n, metrics

- test_nexus.py: extract_pypi/go/npm, dispatch, edge cases (16 тестов)
- test_i18n.py: RU/EN переводы, fallback, форматирование, web UI (10 тестов)
- test_metrics.py: Prometheus endpoint (4 теста)
- test_webhooks.py: _detect_ecosystem (6 тестов), Go/npm webhook fixtures
- conftest.py: sample_nexus_go/npm_webhook fixtures
- Всего: 85 тестов (было 50)
This commit is contained in:
Marker689
2026-05-10 07:58:03 +03:00
parent d11be24c5f
commit f252c256d8
5 changed files with 255 additions and 0 deletions

View File

@@ -209,3 +209,39 @@ def guarddog_normalized_clean():
"findings": [],
"errors": [],
}
@pytest.fixture
def sample_nexus_go_webhook():
return {
"timestamp": "2026-05-10T12:00:00.000+00:00",
"nodeId": "test-node",
"initiator": "admin",
"action": "UPDATED",
"repositoryName": "go-proxy",
"asset": {
"id": "go123",
"assetId": "Z28xMjM=",
"format": "go",
"name": "/packages/github.com/gorilla/mux/@v/v1.8.0.zip",
"downloadUrl": "http://nexus:8081/repository/go-proxy/github.com/gorilla/mux/@v/v1.8.0.zip",
},
}
@pytest.fixture
def sample_nexus_npm_webhook():
return {
"timestamp": "2026-05-10T12:00:00.000+00:00",
"nodeId": "test-node",
"initiator": "admin",
"action": "UPDATED",
"repositoryName": "npm-proxy",
"asset": {
"id": "npm123",
"assetId": "bnBtMTIz",
"format": "npm",
"name": "/packages/lodash/-/lodash-4.17.21.tgz",
"downloadUrl": "http://nexus:8081/repository/npm-proxy/lodash/-/lodash-4.17.21.tgz",
},
}