Skip to main content
tests/test_dashboard.py · chapter Tests and team tooling, file 11 · 140 lines · open in the repository

What it does

Tests for the dashboard (decisions 0008 and 0013): it reads only finished micro-batches, and every view runs without errors, on a laptop and hosted (where there is no local stream).

What is inside

  • APP · line 9
  • write_batch(folder, batch_id, rows, finished) · line 12
  • app(monkeypatch) · line 35

What it checks

  • only finished batches are read in batch order (line 20)
  • a missing output reads as empty (line 30)
  • the live view explains what to do before any output (line 41)
  • the live view waits for a published run when offline (line 51)
  • the hosted app offers published runs only (line 60)
  • every view runs from the committed snapshot (line 70)
  • the replay plays the years picked and warns about training years (line 80)
  • the retailer type filter applies to every count and a followed retailer gets charts (line 94)
  • a changed snapshot is read again not served from the cache (line 109)
  • a changed project module is reloaded with the rest (line 120)

Connections

Uses: src/common/settings.py, src/dashboard/app.py, src/common/study.py, src/dashboard/__init__.py

Source

tests/test_dashboard.py