generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unzip files after retrieving from external SFTP site (#74)
* Unzip files after retrieving from external SFTP site, including applying a password when encrypted * use constants for repeated strings * refactor out mock credential getter so it can be reused * Make test naming consistent * upload SFTP-retrieved file based on file type; update tests * Update README.md Co-authored-by: pluckyswan <96704946+pluckyswan@users.noreply.github.com> Co-authored-by: Samuel Aquino <saquino@flexion.us> Co-authored-by: jcrichlake <145698165+jcrichlake@users.noreply.github.com> Co-authored-by: jherrflexion <118225331+jherrflexion@users.noreply.github.com> Co-authored-by: Tiffini Johnson <86614374+tjohnson7021@users.noreply.github.com>
- Loading branch information
1 parent
55b72bd
commit baf69f5
Showing
30 changed files
with
669 additions
and
185 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 8. Test Naming Convention | ||
|
||
Date: 2024-07-02 | ||
|
||
## Decision | ||
|
||
For consistency, we'll name tests like | ||
`Test_TheMethodBeingTested_TheCoveredScenario_TheExpectedResult`, e.g. | ||
`Test_Unzip_FileIsPasswordProtected_UnzipsSuccessfully`. For a baseline scenario test, | ||
it's okay to do something like `Test_TheMethodBeingTested_TheExpectedResult` | ||
e.g. `Test_getToken_ReturnsAccessToken`. | ||
|
||
## Status | ||
|
||
Accepted. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test123 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package mocks | ||
|
||
import ( | ||
"crypto/rsa" | ||
"github.com/stretchr/testify/mock" | ||
) | ||
|
||
type MockCredentialGetter struct { | ||
mock.Mock | ||
} | ||
|
||
func (m *MockCredentialGetter) GetPrivateKey(privateKeyName string) (*rsa.PrivateKey, error) { | ||
args := m.Called(privateKeyName) | ||
return args.Get(0).(*rsa.PrivateKey), args.Error(1) | ||
} | ||
func (m *MockCredentialGetter) GetSecret(secretName string) (string, error) { | ||
args := m.Called(secretName) | ||
return args.Get(0).(string), args.Error(1) | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains 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
Oops, something went wrong.