1
// Copyright 2013 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
9
jc "github.com/juju/testing/checkers"
10
gc "gopkg.in/check.v1"
12
"github.com/juju/juju/environs/filestorage"
13
"github.com/juju/juju/environs/storage"
16
// CreateLocalTestStorage returns the listener, which needs to be closed, and
17
// the storage that is backed by a directory created in the running test's temp
19
func CreateLocalTestStorage(c *gc.C) (closer io.Closer, stor storage.Storage, dataDir string) {
21
underlying, err := filestorage.NewFileStorageWriter(dataDir)
22
c.Assert(err, jc.ErrorIsNil)
23
return nopCloser{}, underlying, dataDir
26
type nopCloser struct{}
28
func (nopCloser) Close() error {