summaryrefslogtreecommitdiffstats
path: root/resources/testhelpers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'resources/testhelpers_test.go')
-rw-r--r--resources/testhelpers_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/resources/testhelpers_test.go b/resources/testhelpers_test.go
index bc24fb8f2..3e0725452 100644
--- a/resources/testhelpers_test.go
+++ b/resources/testhelpers_test.go
@@ -154,10 +154,14 @@ func fetchImageForSpec(spec *Spec, c *qt.C, name string) resource.Image {
return img
}
-func fetchResourceForSpec(spec *Spec, c *qt.C, name string) resource.ContentResource {
+func fetchResourceForSpec(spec *Spec, c *qt.C, name string, targetPathAddends ...string) resource.ContentResource {
src, err := os.Open(filepath.FromSlash("testdata/" + name))
c.Assert(err, qt.IsNil)
workDir := spec.WorkingDir
+ if len(targetPathAddends) > 0 {
+ addends := strings.Join(targetPathAddends, "_")
+ name = addends + "_" + name
+ }
targetFilename := filepath.Join(workDir, name)
out, err := helpers.OpenFileForWriting(spec.Fs.Source, targetFilename)
c.Assert(err, qt.IsNil)