feat: repo and snapshots packages filter api add 'maximumVersion' query parameter support

example: `curl http://localhost:8080/api/repos/test/packages\?maximumVersion\=1`

Change-Id: Ie9ffd36146bf017bbb353737f32360f7b73d6b0a
This commit is contained in:
hudeng
2022-06-22 13:39:39 +08:00
committed by André Roth
parent 5cf8c54cb2
commit ecc88e7a40
3 changed files with 58 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package api
import (
"bytes"
"encoding/json"
"io"
"net/http"
@@ -128,6 +129,15 @@ func (s *ApiSuite) TestGetMetrics(c *C) {
c.Check(b, Matches, ".*aptly_build_info.*version=\"testVersion\".*")
}
func (s *ApiSuite) TestRepoCreate(c *C) {
body, err := json.Marshal(gin.H{
"Name": "dummy",
})
c.Assert(err, IsNil)
_, err = s.HTTPRequest("POST", "/api/repos", bytes.NewReader(body))
c.Assert(err, IsNil)
}
func (s *ApiSuite) TestTruthy(c *C) {
c.Check(truthy("no"), Equals, false)
c.Check(truthy("n"), Equals, false)