Skip to content

Commit

Permalink
Merge pull request #528 from shizhMSFT/404_on_tag_list
Browse files Browse the repository at this point in the history
fix: allow 404 on tag list for virtual repositories
  • Loading branch information
mikebrow authored Mar 25, 2024
2 parents 35eb578 + 33f0657 commit 75d2816
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions conformance/04_management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,21 @@ var test04ContentManagement = func() {
req := client.NewRequest(reggie.GET, "/v2/<name>/tags/list")
resp, err := client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
tagList := &TagList{}
jsonData := []byte(resp.String())
err = json.Unmarshal(jsonData, tagList)
Expect(err).To(BeNil())
Expect(len(tagList.Tags)).To(BeNumerically("<", numTags))
Expect(resp.StatusCode()).To(SatisfyAny(
Equal(http.StatusNotFound),
Equal(http.StatusOK),
))
expectTags := numTags - 1
if resp.StatusCode() == http.StatusOK {
tagList := &TagList{}
jsonData := []byte(resp.String())
err = json.Unmarshal(jsonData, tagList)
Expect(err).To(BeNil())
Expect(len(tagList.Tags)).To(Equal(expectTags))
}
if resp.StatusCode() == http.StatusNotFound {
Expect(expectTags).To(Equal(0))
}
})
})

Expand Down

0 comments on commit 75d2816

Please sign in to comment.