ntopng/python/tests
Copilot bda3c861b9
Add comprehensive unit tests for Python SDK and additional Lua ts_common tests (#10227)
- Add python/tests/test_ntopng_sdk.py with 86 unit tests covering:
  - Ntopng: constructor (auth_token / user+pass), request/post_request wrappers,
    all getter methods, debug flag, URL building
  - Interface: all data, alert, flow, L7/L4 and host methods
  - Host: get_host_data, get_l7_stats, get_dscp_stats (both directions), VLAN handling
  - Historical: all alert family delegates, timeseries, flows, conversations
- Fix bug in historical.py get_host_top_protocols(): self.ifid (int) was
  concatenated with strings without str() conversion, causing TypeError at runtime
- Add scripts/lua/modules/timeseries/tests/ts_common_test.lua with 11 test cases:
  - upsampleSerie: no-op when target <= source length, empty serie
  - calculateMinMax: basic, single element, NaN-skipping
  - calculateStatistics: counter (total*step), gauge+keep_total, gauge no-total, NaN-skipping
  - ninetififthPercentile: single element, all-NaN
- Register ts_common_test in the Lua test runner (run.lua)

Agent-Logs-Url: https://github.com/ntop/ntopng/sessions/32da23c3-306c-4100-9bbe-64b91191653b

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lucaderi <4493366+lucaderi@users.noreply.github.com>
2026-05-10 22:22:58 +02:00
..
__pycache__ Add comprehensive unit tests for Python SDK and additional Lua ts_common tests (#10227) 2026-05-10 22:22:58 +02:00
__init__.py Add comprehensive unit tests for Python SDK and additional Lua ts_common tests (#10227) 2026-05-10 22:22:58 +02:00
test_ntopng_sdk.py Add comprehensive unit tests for Python SDK and additional Lua ts_common tests (#10227) 2026-05-10 22:22:58 +02:00