-
Notifications
You must be signed in to change notification settings - Fork 10
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
Unit tests #15
Unit tests #15
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
==========================================
+ Coverage 75.28% 80.00% +4.71%
==========================================
Files 6 6
Lines 963 955 -8
==========================================
+ Hits 725 764 +39
+ Misses 126 101 -25
+ Partials 112 90 -22
Continue to review full report at Codecov.
|
cmd/provision/legacy.go
Outdated
if resp.StatusCode > 299 { | ||
return nil, fmt.Errorf("creating credential, status: %d", resp.StatusCode) | ||
} | ||
// if resp.StatusCode > 299 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don’t need this, we should remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I will remove it. ApigeeClient explicitly checks the status code and return error on non-2XX codes.
cmd/provision/legacy.go
Outdated
res, err = client.Do(req) | ||
if res != nil { | ||
defer res.Body.Close() | ||
} | ||
} | ||
if err != nil { | ||
if res.StatusCode > 299 || err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know for certain that res will not be nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Will add the null check.
Thanks! |
Resolves #3
The coverage will certainly change as the cli evolves. At least for now it is at 80%, ;-)