diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-07-27 03:59:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-27 09:59:10 +0800 |
commit | a3d55ac52337ecc843a0ff353cde9e5a46b7f463 (patch) | |
tree | 206f1c14eaf3ddb73a75731bb4b6f8c75bad706e /integrations | |
parent | 5ed082b62491f17c6c91e21f8fe7d544559b0ea1 (diff) | |
download | gitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.tar.gz gitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.zip |
Hide internal package versions (#20492)
* Hide internal versions from most searches.
* Added test.
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/api_packages_container_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/integrations/api_packages_container_test.go b/integrations/api_packages_container_test.go index 1ed80dfd02..bdb8e2e90e 100644 --- a/integrations/api_packages_container_test.go +++ b/integrations/api_packages_container_test.go @@ -20,6 +20,7 @@ import ( container_module "code.gitea.io/gitea/modules/packages/container" "code.gitea.io/gitea/modules/packages/container/oci" "code.gitea.io/gitea/modules/setting" + api "code.gitea.io/gitea/modules/structs" "github.com/stretchr/testify/assert" ) @@ -487,6 +488,13 @@ func TestPackageContainer(t *testing.T) { assert.Equal(t, c.ExpectedTags, tagList.Tags) assert.Equal(t, c.ExpectedLink, resp.Header().Get("Link")) } + + req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/packages/%s?type=container&q=%s", user.Name, image)) + resp := MakeRequest(t, req, http.StatusOK) + + var apiPackages []*api.Package + DecodeJSON(t, resp, &apiPackages) + assert.Len(t, apiPackages, 4) // "latest", "main", "multi", "sha256:..." }) t.Run("Delete", func(t *testing.T) { |