Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit f162b55

Browse files
committed
206-doublestar-mount Simplified config_test and fixed duplicate constants
1 parent ba52e9b commit f162b55

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

internal/plugin/config_test.go

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,11 @@ import (
44
"fmt"
55
"os"
66
"reflect"
7-
"strings"
87
"testing"
9-
"time"
108

11-
"github.com/meltwater/drone-cache/archive"
129
"github.com/meltwater/drone-cache/test"
1310
)
1411

15-
const (
16-
testRoot = "testdata"
17-
defaultStorageOperationTimeout = 5 * time.Second
18-
)
19-
2012
func TestHandleMount(t *testing.T) {
2113
test.Ok(t, os.Mkdir(testRoot, 0755))
2214
t.Cleanup(func() {
@@ -62,7 +54,7 @@ func TestHandleMount(t *testing.T) {
6254
}
6355

6456
for _, tc := range cases {
65-
c := defaultConfig()
57+
c := Config{}
6658
c.Mount = tc.mounts
6759

6860
tc.makeFiles()
@@ -72,23 +64,3 @@ func TestHandleMount(t *testing.T) {
7264
"expected mount differs from handled mount result:\nexpected: %v\ngot:%v", tc.expectedMounts, c.Mount)
7365
}
7466
}
75-
76-
// Config plugin configuration
77-
78-
func defaultConfig() *Config {
79-
return &Config{
80-
CompressionLevel: archive.DefaultCompressionLevel,
81-
StorageOperationTimeout: defaultStorageOperationTimeout,
82-
Override: true,
83-
}
84-
}
85-
86-
func containsGlob(a []string) bool {
87-
for _, v := range a {
88-
if strings.Contains(v, "**") {
89-
return true
90-
}
91-
}
92-
93-
return false
94-
}

0 commit comments

Comments
 (0)