Improve the assertions for the downloaded solution metadata#676
Merged
Improve the assertions for the downloaded solution metadata#676
Conversation
nywilken
suggested changes
Jul 25, 2018
Contributor
nywilken
left a comment
There was a problem hiding this comment.
I like this approach better for sure. I thought about recommending that you drop the requestorSelf and requestorOther before but I never mentioned it.
This looks good. I have two minor recommended changes before you merge.
| assert.NoError(t, err) | ||
|
|
||
| ts := fakeDownloadServer(tc.requestor) | ||
| ts := fakeDownloadServer(fmt.Sprintf("%v", tc.requester)) |
Contributor
There was a problem hiding this comment.
strconv.FormatBool(tc.requester) is what you want here.
Member
Author
There was a problem hiding this comment.
Ooooh, love it. Thanks!
| flags: map[string]string{"uuid": "bogus-id"}, | ||
| }, | ||
| { | ||
| requestor: requestorOther, |
Contributor
There was a problem hiding this comment.
These constants are still defined below but no longer used
Member
Author
There was a problem hiding this comment.
Nice, thank you for catching that.
We don't need to check the entire downloaded JSON, we just want to make sure it got downloaded and has the crucial bits of data that we passed to the server.
de7f541 to
0c3ac4d
Compare
Member
Author
|
I fixed the last details and force pushed, @nywilken. |
nywilken
approved these changes
Jul 25, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The hard-coded JSON for the metadata was annoying me. The big JSON is hard to read. We improved it a bit by writing the JSON as multiline, and then compacting it using
json.Compact()but it still felt brittle.This improves it further by reading the JSON into a solution struct and just checking the fields we care about.