test: new changes related to filesystem.CreateDirectory
This commit is contained in:
@@ -147,6 +147,7 @@ func TestImportTask_Do(t *testing.T) {
|
||||
mock.ExpectQuery("SELECT(.+)folders").WillReturnRows(sqlmock.NewRows([]string{"id"}))
|
||||
// 创建文件时查找父目录,仍然不存在
|
||||
mock.ExpectQuery("SELECT(.+)folders").WillReturnRows(sqlmock.NewRows([]string{"id"}))
|
||||
mock.ExpectQuery("SELECT(.+)folders").WillReturnRows(sqlmock.NewRows([]string{"id"}))
|
||||
|
||||
task.Do()
|
||||
|
||||
@@ -177,6 +178,7 @@ func TestImportTask_Do(t *testing.T) {
|
||||
mock.ExpectQuery("SELECT(.+)files").WillReturnRows(sqlmock.NewRows([]string{"id"}))
|
||||
// 创建目录
|
||||
mock.ExpectBegin()
|
||||
mock.ExpectQuery("SELECT(.+)folders").WillReturnRows(sqlmock.NewRows([]string{"id"}))
|
||||
mock.ExpectExec("INSERT(.+)folders(.+)").WillReturnResult(sqlmock.NewResult(2, 1))
|
||||
mock.ExpectCommit()
|
||||
// 插入文件记录
|
||||
|
||||
Reference in New Issue
Block a user