-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add test cases to pkg/quay (#53)
* Rewrite part of the test functions in order to add test cases conveniently. * handleRobotName is refactored slightly. 1) Once the input robotName is matched, no need the check the number of parts separated by +. 2) The regexp is hardcoded and not an input from somewhere else, and the tests ensure that the regexp is correct and can be compiled by the library. So, no need to handle the err of an invalid regexp. * Unify the type of response data passed to gock JSON func so that string value can be passed as well. * Assertions are written with gotest.tools assert functions. One of the benefits is the error can be easily checked if it is nil and if a specific err is returned by specifying part of the error message. Signed-off-by: Chenxiong Qi <[email protected]>
- Loading branch information
Showing
4 changed files
with
670 additions
and
277 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
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.