Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conformance: check response status before checking location #420

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions conformance/02_push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ var test02Push = func() {
resp, err := client.Do(req)
Expect(err).To(BeNil())
location := resp.Header().Get("Location")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why not colocate this line with the Expect line itself? interrupts readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is the way it's done in every other test and this PR is about changing exactly one property of a couple of tests, not changing things which are technically fine the way they are now and might have been done for good reason.

If we were to change other aspects of these tests, there are way more important things to do, in my view (see #416 for an example).

Expect(location).ToNot(BeEmpty())
Expect(resp.StatusCode()).To(Equal(http.StatusAccepted))
Expect(location).ToNot(BeEmpty())
lastResponse = resp
})

Expand All @@ -246,9 +246,9 @@ var test02Push = func() {
SetQueryParam("digest", testBlobBDigest)
resp, err := client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(Equal(http.StatusCreated))
location := resp.Header().Get("Location")
Expect(location).ToNot(BeEmpty())
Expect(resp.StatusCode()).To(Equal(http.StatusCreated))
})
})

Expand Down