dataprovider move db handle to provider struct

This is needed to support non SQL providers
This commit is contained in:
Nicola Murino
2019-08-11 14:53:37 +02:00
parent 51aacae3c5
commit cb87fe811a
7 changed files with 74 additions and 58 deletions

View File

@@ -99,11 +99,18 @@ func TestUploadFiles(t *testing.T) {
uploadMode = oldUploadMode
}
func TestLoginWithInvalidHome(t *testing.T) {
func TestWithInvalidHome(t *testing.T) {
u := dataprovider.User{}
u.HomeDir = "home_rel_path"
_, err := loginUser(u)
if err == nil {
t.Errorf("login a user with an invalid home_dir must fail")
}
c := Connection{
User: u,
}
err = c.isSubDir("dir_rel_path")
if err == nil {
t.Errorf("tested path is not a home subdir")
}
}