Page MenuHomeSoftware Heritage

service: Fix possible error when looking latest origin visit
ClosedPublic

Authored by anlambert on Nov 12 2019, 5:13 PM.

Details

Summary

When an origin did not get visited yet, an error was raised when calling
the service.lookup_origin_visit_latest function.

Also add a test to ensure the /origin/visit/latest/ endpoint of the web api
returns a 404 status code when no visit exists for an origin.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Shouldn't the new test code be in its own function?

Shouldn't the new test code be in its own function?

Indeed, seems better to add a new test function here.

Update: Move new test implementation in a dedicated function

This revision is now accepted and ready to land.Nov 12 2019, 6:29 PM