Skip to main content
tests/test_config.py · chapter Tests and team tooling, file 2 · 89 lines · open in the repository

What it does

The registries in config/ (retailers, Wikipedia articles, retail series) must follow their contracts, so anyone can add a retailer, an article or a series by adding a row without breaking the pipeline. The event calendar has its own tests (test_event_calendar.py).

What is inside

What it checks

  • retailer tickers are unique yahoo symbols (line 23)
  • retailer columns use known values (line 30)
  • market index is not listed as a retailer (line 38)
  • some retailers are in scope (line 44)
  • every wiki article belongs to a listed retailer (line 48)
  • every in scope retailer has a wiki article (line 54)
  • wiki titles are unique and use underscores (line 60)
  • in scope articles skip candidate retailers (line 66)
  • retail series ids and categories are unique (line 71)
  • loaders reject a file whose columns do not match the contract (line 79)
  • loaders read files saved by excel (line 86)

Connections

Uses: src/common/contracts.py, src/common/study.py

Source

tests/test_config.py