aboutsummaryrefslogtreecommitdiff
path: root/internal/conf/mocks.go
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2022-10-22 14:41:40 +0800
committerGitHub <noreply@github.com>2022-10-22 14:41:40 +0800
commitc502dc6ed888a4cf2c8b36176585f4166536ab6d (patch)
tree71e3f758069dc2435eecb88ae786b2efaaa972f9 /internal/conf/mocks.go
parent260e990be75885e1a560df449dacdeecafeffdcf (diff)
refactor(db): move some methods from `user.go` to `users.go` (#7195)
Diffstat (limited to 'internal/conf/mocks.go')
-rw-r--r--internal/conf/mocks.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/conf/mocks.go b/internal/conf/mocks.go
index d4e57d38..af5b1bd7 100644
--- a/internal/conf/mocks.go
+++ b/internal/conf/mocks.go
@@ -16,6 +16,14 @@ func SetMockApp(t *testing.T, opts AppOpts) {
})
}
+func SetMockAuth(t *testing.T, otps AuthOpts) {
+ before := Auth
+ Auth = otps
+ t.Cleanup(func() {
+ Auth = before
+ })
+}
+
func SetMockServer(t *testing.T, opts ServerOpts) {
before := Server
Server = opts