mirror of
https://github.com/rclone/rclone.git
synced 2024-12-03 22:12:02 +01:00
24 lines
383 B
Go
24 lines
383 B
Go
|
package check
|
||
|
|
||
|
import (
|
||
|
"io/ioutil"
|
||
|
"os"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestCheckDir(t *testing.T) {
|
||
|
// Path not exist.
|
||
|
assert.Error(t, Dir("/not-exist-dir"))
|
||
|
|
||
|
// Path is not directory.
|
||
|
f, err := ioutil.TempFile(os.TempDir(), "test-check-dir-")
|
||
|
assert.NoError(t, err)
|
||
|
f.Close()
|
||
|
os.Remove(f.Name())
|
||
|
|
||
|
// OK.
|
||
|
assert.NoError(t, Dir(os.TempDir()))
|
||
|
}
|