diff options
author | Joe Chen <jc@unknwon.io> | 2022-06-25 18:07:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-25 18:07:39 +0800 |
commit | 083c3ee659c6c5542687f3bafae68cbc24dbc90f (patch) | |
tree | 0103bf3b5c5ebfccd368a7cb6a425a521fd669d9 /internal/conf/mocks.go | |
parent | 9df4e3ae3c555a86f691f0d78a43834842e77d8b (diff) |
db: refactor "action" table to use GORM (#7054)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/conf/mocks.go')
-rw-r--r-- | internal/conf/mocks.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/internal/conf/mocks.go b/internal/conf/mocks.go index 1f8e16f2..d4e57d38 100644 --- a/internal/conf/mocks.go +++ b/internal/conf/mocks.go @@ -8,6 +8,14 @@ import ( "testing" ) +func SetMockApp(t *testing.T, opts AppOpts) { + before := App + App = opts + t.Cleanup(func() { + App = before + }) +} + func SetMockServer(t *testing.T, opts ServerOpts) { before := Server Server = opts @@ -15,3 +23,27 @@ func SetMockServer(t *testing.T, opts ServerOpts) { Server = before }) } + +func SetMockSSH(t *testing.T, opts SSHOpts) { + before := SSH + SSH = opts + t.Cleanup(func() { + SSH = before + }) +} + +func SetMockRepository(t *testing.T, opts RepositoryOpts) { + before := Repository + Repository = opts + t.Cleanup(func() { + Repository = before + }) +} + +func SetMockUI(t *testing.T, opts UIOpts) { + before := UI + UI = opts + t.Cleanup(func() { + UI = before + }) +} |