-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add load_from_pem_data test #986
Add load_from_pem_data test #986
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## devel #986 +/- ##
==========================================
+ Coverage 39.89% 40.12% +0.22%
==========================================
Files 42 42
Lines 6617 6617
==========================================
+ Hits 2640 2655 +15
+ Misses 3773 3754 -19
- Partials 204 208 +4 |
} | ||
|
||
func setupGoodRSAPrivateKeyPEMData() []byte { | ||
return []byte(`-----BEGIN RSA PRIVATE KEY----- |
Check failure
Code scanning / SonarCloud
Cryptographic private keys should not be disclosed
2a05ab7
to
8471fd7
Compare
pkg/certificates/ca_test.go
Outdated
defer ctrl.Finish() | ||
|
||
o := mock_certificates.NewMockOser(ctrl) | ||
switch tt.args.filename { |
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.
This whole switch case can be swaped for a function pointer in the test case list, something like this: https://github.com/ansible/receptor/blob/devel/pkg/workceptor/workceptor_test.go#L140
pkg/certificates/ca_test.go
Outdated
|
||
o := mock_certificates.NewMockOser(ctrl) | ||
switch tt.args.filename { | ||
case failedToDecodeTestFilename: |
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.
same as previous comment 😄
I think keeping the expected calls with the test case definition in the list is more readable
Quality Gate passedIssues Measures |
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
No description provided.