File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -9,20 +9,26 @@ import (
99 "code.gitea.io/gitea/modules/git"
1010 "code.gitea.io/gitea/modules/setting"
1111 api "code.gitea.io/gitea/modules/structs"
12+ "code.gitea.io/gitea/modules/test"
1213 webhook_module "code.gitea.io/gitea/modules/webhook"
1314
1415 "github.com/stretchr/testify/assert"
1516)
1617
17- func fullWorkflowContent (yamlOn string ) []byte {
18- return []byte ("name: test\n " + yamlOn + "\n jobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - run: echo hello\n " )
18+ func fullWorkflowContent (part string ) []byte {
19+ return []byte (`
20+ name: test
21+ ` + part + `
22+ jobs:
23+ test:
24+ runs-on: ubuntu-latest
25+ steps:
26+ - run: echo hello
27+ ` )
1928}
2029
2130func TestIsWorkflow (t * testing.T ) {
22- oldDirs := setting .Actions .WorkflowDirs
23- defer func () {
24- setting .Actions .WorkflowDirs = oldDirs
25- }()
31+ defer test .MockVariableValue (& setting .Actions .WorkflowDirs )()
2632
2733 tests := []struct {
2834 name string
You can’t perform that action at this time.
0 commit comments