browse/snapshot_context: Refactor, add type annotations and tests
On the road to #2342 (closed), second part of #2360 (closed).
Slightly refactor and improve the swh.web.browse.snapshot_context module:
-
merge
_process_snapshot_request
function intoget_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
That diff is quite large as I performed some keys renaming in dictionaries spanning numerous files. I have also added mising tests.
Migrated from D3041 (view on Phabricator)