aboutsummaryrefslogtreecommitdiff
path: root/internal/mocks
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-04-06 18:35:10 +0800
committerGitHub <noreply@github.com>2020-04-06 18:35:10 +0800
commitee0ea2c5fc9f470512acf3f15834f14f8df9d737 (patch)
tree077bbea20818621e98d3a46ab01c0be235c2d25c /internal/mocks
parent4d7db6e1c108cee234422b34e3252ab217c461cc (diff)
lfs: add unit test for middleware (#6070)
* Add unit test for `authenticate` middleware * Add more cases * Add tests for verifyOID and internalServerError * Add tests for verifyHeader * Add tests for authroize
Diffstat (limited to 'internal/mocks')
-rw-r--r--internal/mocks/locale.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/mocks/locale.go b/internal/mocks/locale.go
new file mode 100644
index 00000000..ef95e056
--- /dev/null
+++ b/internal/mocks/locale.go
@@ -0,0 +1,24 @@
+// 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 mocks
+
+import (
+ "gopkg.in/macaron.v1"
+)
+
+var _ macaron.Locale = (*Locale)(nil)
+
+type Locale struct {
+ MockLang string
+ MockTr func(string, ...interface{}) string
+}
+
+func (l *Locale) Language() string {
+ return l.MockLang
+}
+
+func (l *Locale) Tr(format string, args ...interface{}) string {
+ return l.MockTr(format, args...)
+}