-
Notifications
You must be signed in to change notification settings - Fork 20
Fix --expires-on flag parsing #78
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
Conversation
| var apiClient utl.APIer | ||
| var out observ.OutputWriter | ||
| var ApiClient utl.APIer | ||
| var Out observ.OutputWriter |
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.
Needed to make these public, so I can mock them in tests
(our lease service relies on global variables)
| expiry, err := s.Util.ExpandEpochTime(expiresOn) | ||
|
|
||
| if err != nil && expiry > 0 { | ||
| if err == nil && expiry > 0 { |
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.
👆 Here's the bug
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.
Sigh...
Nicely done.
| ) | ||
|
|
||
| func TestLeasesCreate(t *testing.T) { | ||
| cli := NewCLITest(t) |
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.
Put together a quick happy-path test for dce leases create. Could/should be expanded in the future, to cover other use cases
| } | ||
| params.SetTimeout(5 * time.Second) | ||
| _, err := apiClient.PostAccounts(params, nil) | ||
| _, err := ApiClient.PostAccounts(params, 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.
Needed to make these public, so I can mock them in tests
(our lease service relies on global variables)
nathanagood
left a comment
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.
LGTM; nice work.
| expiry, err := s.Util.ExpandEpochTime(expiresOn) | ||
|
|
||
| if err != nil && expiry > 0 { | ||
| if err == nil && expiry > 0 { |
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.
Sigh...
Nicely done.
bf28aa8 to
2e0c4c4
Compare
2e0c4c4 to
db9ae00
Compare
Proposed changes
Fixes #77
Add basic integration test coverage around
dce leases createTypes of changes
Checklist
README.md, inline comments, etc.)CHANGELOG.mdunder a## nextrelease, with a short summary of my changesRelevant Links