kojiapi: add simple test for the /status API

Add a simple unit test for the koji API.

This adds a Handler() method to the koji.Server struct, which made
writing the test easier. This is a direction we want to go in anyway in
the future.
This commit is contained in:
Lars Karlitski 2020-10-13 16:16:22 +02:00
parent 6b137d0ac5
commit d7bff4bd3b
2 changed files with 57 additions and 0 deletions

View file

@ -64,6 +64,10 @@ func (s *Server) Serve(listener net.Listener) error {
return nil
}
func (s *Server) Handler() http.Handler {
return s.server.Handler
}
// apiHandlers implements api.ServerInterface - the http api route handlers
// generated from api/openapi.yml. This is a separate object, because these
// handlers should not be exposed on the `Server` object.