diff options
author | Nick White <git@njw.name> | 2021-08-02 10:45:53 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2021-08-02 10:45:53 +0100 |
commit | 4b7a4bd1b87d1dbba283e577aa03ce7e390d85d8 (patch) | |
tree | e5e7e55763cfbfd74e651a4ba5bea5b7394a93a9 /local.go | |
parent | 5310a5e77e945debdc7bd6f149ba87fab13902db (diff) |
internal/pipeline: Add test (incomplete but working) for UploadImages
Diffstat (limited to 'local.go')
-rw-r--r-- | local.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -21,6 +21,7 @@ const qidOCR = "queueOCR" const qidAnalyse = "queueAnalyse" const qidTest = "queueTest" const storageId = "storage" +const testStorageId = "test" // LocalConn is a simple implementation of the pipeliner interface // that doesn't rely on any "cloud" services, instead doing everything @@ -66,6 +67,11 @@ func (a *LocalConn) Init() error { // TestInit does nothing for local connections func (a *LocalConn) TestInit() error { + err := os.Mkdir(filepath.Join(a.TempDir, testStorageId), 0700) + if err != nil && !os.IsExist(err) { + return fmt.Errorf("Error creating test storage directory: %v", err) + } + return nil } @@ -134,6 +140,11 @@ func (a *LocalConn) WIPStorageId() string { return storageId } +func (a *LocalConn) TestStorageId() string { + return testStorageId +} + + func prefixwalker(dirpath string, prefix string, list *[]ObjMeta) filepath.WalkFunc { return func(path string, info os.FileInfo, err error) error { if err != nil { |