28 lines
420 B
Go
28 lines
420 B
Go
package fs
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestContainer(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
require := require.New(t)
|
|
|
|
fss := map[string]Filesystem{
|
|
"/test": &DummyFs{},
|
|
}
|
|
|
|
c, err := NewContainerFs(fss)
|
|
require.NoError(err)
|
|
|
|
f, err := c.Open("/test/dir/here")
|
|
require.NoError(err)
|
|
require.NotNil(f)
|
|
|
|
files, err := c.ReadDir("/")
|
|
require.NoError(err)
|
|
require.Len(files, 1)
|
|
}
|