api/revision: Fix /revision/directory endpoint and improve tests
That endpoint was currently returning an error 500 as some breaking changes were missed due to the use of mocking in tests (see https://archive.softwareheritage.org/api/1/revision/f1b94134a4b879bc55c3dacdb496690c8ebdc03f/directory/).
So fix the issue and ensure asociated tests do not use any mocks anymore.
Depends on !451 (closed)
Migrated from D4567 (view on Phabricator)