mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
simplify scp upload code and add some test cases
This commit is contained in:
@@ -275,6 +275,10 @@ func TestDirCommands(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("error mkdir all: %v", err)
|
||||
}
|
||||
_, err = client.ReadDir("/this/dir/does/not/exist")
|
||||
if err == nil {
|
||||
t.Errorf("reading a missing dir must fail")
|
||||
}
|
||||
testFileName := "/test_file.dat"
|
||||
testFilePath := filepath.Join(homeBasePath, testFileName)
|
||||
testFileSize := int64(65535)
|
||||
@@ -334,6 +338,10 @@ func TestSymlink(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("error creating symlink: %v", err)
|
||||
}
|
||||
_, err = client.ReadLink(testFileName + ".link")
|
||||
if err == nil {
|
||||
t.Errorf("readlink is currently not implemented so must fail")
|
||||
}
|
||||
err = client.Symlink(testFileName, testFileName+".link")
|
||||
if err == nil {
|
||||
t.Errorf("creating a symlink to an existing one must fail")
|
||||
|
||||
Reference in New Issue
Block a user