aboutsummaryrefslogtreecommitdiff
path: root/internal/mock
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/mock
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/mock')
-rw-r--r--internal/mock/locale.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/internal/mock/locale.go b/internal/mock/locale.go
deleted file mode 100644
index fbd91da1..00000000
--- a/internal/mock/locale.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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 mock
-
-import (
- "gopkg.in/macaron.v1"
-)
-
-var _ macaron.Locale = (*Locale)(nil)
-
-// Locale is a mock that implements macaron.Locale.
-type Locale struct {
- lang string
- tr func(string, ...interface{}) string
-}
-
-// NewLocale creates a new mock for macaron.Locale.
-func NewLocale(lang string, tr func(string, ...interface{}) string) *Locale {
- return &Locale{
- lang: lang,
- tr: tr,
- }
-}
-
-func (l *Locale) Language() string {
- return l.lang
-}
-
-func (l *Locale) Tr(format string, args ...interface{}) string {
- return l.tr(format, args...)
-}