databricks-cli/libs/filer/local_client_test.go

26 lines
531 B
Go
Raw Permalink Normal View History

2023-06-15 22:54:00 +00:00
package filer
import (
"context"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
2023-06-18 23:37:01 +00:00
func TestLocalClientAtRootOfFilesystem(t *testing.T) {
2023-06-15 22:54:00 +00:00
tmpDir := t.TempDir()
ctx := context.Background()
// create filer root at "root"
f, err := NewLocalClient("/")
require.NoError(t, err)
// Assert stat call to the temp dir succeeds.
info, err := f.Stat(ctx, tmpDir)
assert.NoError(t, err)
assert.Equal(t, filepath.Base(tmpDir), info.Name())
assert.True(t, info.IsDir())
}