aboutsummaryrefslogtreecommitdiff
path: root/internal/conf/mocks.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-04-06 23:53:55 +0800
committerGitHub <noreply@github.com>2020-04-06 23:53:55 +0800
commit2b3655fa118abaa33a0e064233fdc8c670487c62 (patch)
treec160e5aaa886e920f4cef8bd2bb29a002e6399fe /internal/conf/mocks.go
parentca2f7a7e1610fd8e99649dc1ed2058c2f362c57d (diff)
lfs: add tests to batch endpoint (#6073)
Diffstat (limited to 'internal/conf/mocks.go')
-rw-r--r--internal/conf/mocks.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/conf/mocks.go b/internal/conf/mocks.go
new file mode 100644
index 00000000..1f8e16f2
--- /dev/null
+++ b/internal/conf/mocks.go
@@ -0,0 +1,17 @@
+// Copyright 2020 The Gogs Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package conf
+
+import (
+ "testing"
+)
+
+func SetMockServer(t *testing.T, opts ServerOpts) {
+ before := Server
+ Server = opts
+ t.Cleanup(func() {
+ Server = before
+ })
+}