Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
trying to fix scm_github_access_token_type mocking.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jul 22, 2019
1 parent 4669973 commit ec99f20
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/scm/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (suite *ScmTestSuite) TestCreate_Invalid() {

func (suite *ScmTestSuite) TestCreate_Github() {
//setup
suite.Config.EXPECT().SetDefault(gomock.Any(), gomock.Any()).MinTimes(1)
suite.Config.EXPECT().GetString("scm_github_access_token").Return("placeholder")
suite.Config.EXPECT().IsSet("scm_github_api_endpoint").Return(false)
suite.Config.EXPECT().IsSet("scm_github_access_token").Return(true)
Expand Down
1 change: 1 addition & 0 deletions pkg/scm/scm_bitbucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ func (suite *ScmBitbucketTestSuite) TestScmBitbucket_CheckoutPushPayload() {

func (suite *ScmBitbucketTestSuite) TestScmBitbucket_CheckoutPushPayload_WithInvalidPayload() {
//setup
suite.Config.EXPECT().SetDefault(gomock.Any(), gomock.Any()).MinTimes(1)
suite.Config.EXPECT().IsSet("scm_github_access_token").Return(true) //used by the init function
suite.Config.EXPECT().IsSet("scm_github_api_endpoint").Return(false)
suite.Config.EXPECT().IsSet("scm_git_parent_path").Return(false)
Expand Down
1 change: 1 addition & 0 deletions pkg/scm/scm_github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ func TestScmGithub_CheckoutPushPayload(t *testing.T) {
mockConfig.EXPECT().IsSet("scm_github_access_token").Return(true) //used by the init function
mockConfig.EXPECT().IsSet("scm_github_api_endpoint").Return(false)
mockConfig.EXPECT().GetString("scm_github_access_token").Return("") //set the Access Token to empty string before doing checkout
mockConfig.EXPECT().GetString("scm_github_access_token_type").Return("user") //set the Access Token Type
// (so that git doesnt fail on placeholder token)
mockConfig.EXPECT().IsSet("scm_git_parent_path").Return(false)
mockConfig.EXPECT().IsSet("scm_pull_request").Return(false)
Expand Down

0 comments on commit ec99f20

Please sign in to comment.