2
0

mocks.go 328 B

1234567891011121314151617
  1. // Copyright 2020 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package conf
  5. import (
  6. "testing"
  7. )
  8. func SetMockServer(t *testing.T, opts ServerOpts) {
  9. before := Server
  10. Server = opts
  11. t.Cleanup(func() {
  12. Server = before
  13. })
  14. }