MCPcopy Create free account
hub / github.com/gogs/gogs / TestIsProdMode

Function TestIsProdMode

internal/conf/computed_test.go:13–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestIsProdMode(t *testing.T) {
14 before := App.RunMode
15 defer func() {
16 App.RunMode = before
17 }()
18
19 tests := []struct {
20 mode string
21 want bool
22 }{
23 {mode: "dev", want: false},
24 {mode: "test", want: false},
25
26 {mode: "prod", want: true},
27 {mode: "Prod", want: true},
28 {mode: "PROD", want: true},
29 }
30 for _, test := range tests {
31 t.Run("", func(t *testing.T) {
32 App.RunMode = test.mode
33 assert.Equal(t, test.want, IsProdMode())
34 })
35 }
36}
37
38func TestWorkDirHelper(_ *testing.T) {
39 if !testutil.WantHelperProcess() {

Callers

nothing calls this directly

Calls 1

IsProdModeFunction · 0.85

Tested by

no test coverage detected