test : add unit tests for _parse_discovered_at in executor

Aperta
#2,325 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@tmdeveloper007 ci sta già lavorando.

Dal 3/8/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Summary of What Needs to be Done:
The _parse_discovered_at function in backend/secuscan/executor.py has minimal test coverage. Existing tests only verify basic UTC conversion. Add comprehensive edge case tests.

Changes that Need to be Made:

  • Add a new test file: testing/backend/unit/test_executor_parse_discovered_at.py
  • Test _parse_discovered_at with valid ISO datetime string (Z suffix)
  • Test _parse_discovered_at with explicit timezone offset (converted to UTC)
  • Test _parse_discovered_at with SQLite-style space separator
  • Test _parse_discovered_at when discovered_at is missing from dict (falls back to utc_now)
  • Test _parse_discovered_at when discovered_at is explicitly None (falls back to utc_now)
  • Test _parse_discovered_at with invalid string (falls back to utc_now)
  • Test _parse_discovered_at with empty string (falls back to utc_now)
  • Test _parse_discovered_at when discovered_at is already a datetime object

Impact that it would Provide:

  • Reliability: Timestamp fallback behavior is verified
  • Maintainability: Prevents regressions when timestamp parsing logic changes
  • Testing coverage: Improves overall test coverage for the executor module

Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.

Lingua principale
Python
Stelle
36
Fork
234
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di utksh1/SecuScan

Tutte le issue di utksh1/SecuScan

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.