HomeSoftware Heritage

browse/snapshot_context: Refactor, add type annotations and tests

Description

browse/snapshot_context: Refactor, add type annotations and tests

Slightly refactor and improve the swh.web.browse.snapshot_context module:

  • merge _process_snapshot_request function into get_snapshot_context one
  • rename some dict keys and add snapshot / origin related type annotations
  • cleanup and simplify get_snapshot_context implementation
  • update some docstrings
  • add new exhaustive tests for get_snapshot_context function

Closes T2360