Skip to content

Commit

Permalink
revert case
Browse files Browse the repository at this point in the history
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
  • Loading branch information
Wwwsylvia committed Jan 21, 2025
1 parent 00fce8e commit 43165c0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions registry/remote/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7815,6 +7815,32 @@ func TestManifestStore_generateDescriptor(t *testing.T) {
wantDescriptor: ocispec.Descriptor{},
wantErr: true,
},
{
name: "resp with body, missing Docker-Content-Digest",
resp: &http.Response{
Header: http.Header{
"Content-Type": []string{mediaType},
},
ContentLength: dataSize,
Request: &http.Request{
Method: http.MethodGet,
URL: &url.URL{Path: "/test"},
},
Body: io.NopCloser(bytes.NewReader(data)),
},
ref: registry.Reference{
Registry: "registry.example.com",
Repository: "hello-world",
Reference: dataDigest.String(),
},
httpMethod: http.MethodGet,
wantDescriptor: ocispec.Descriptor{
MediaType: mediaType,
Digest: dataDigest,
Size: dataSize,
},
wantErr: false,
},
{
name: "failed to read resp with body, missing Docker-Content-Digest",
resp: &http.Response{
Expand Down

0 comments on commit 43165c0

Please sign in to comment.