Fix: uint may overflow / Test: get user storage

This commit is contained in:
HFO4
2019-12-07 15:05:48 +08:00
parent 9386371097
commit f4c414c0f6
11 changed files with 126 additions and 61 deletions

View File

@@ -299,17 +299,17 @@ func TestFileSystem_Delete(t *testing.T) {
mock.ExpectQuery("SELECT(.+)").WillReturnRows(sqlmock.NewRows([]string{"id", "type"}).AddRow(1, "local"))
// 删除文件记录
mock.ExpectBegin()
mock.ExpectExec("DELETE(.+)").
mock.ExpectExec("DELETE(.+)files").
WillReturnResult(sqlmock.NewResult(0, 3))
mock.ExpectCommit()
// 归还容量
mock.ExpectBegin()
mock.ExpectExec("UPDATE(.+)").
mock.ExpectExec("UPDATE(.+)users").
WillReturnResult(sqlmock.NewResult(0, 3))
mock.ExpectCommit()
// 删除目录
mock.ExpectBegin()
mock.ExpectExec("DELETE(.+)").
mock.ExpectExec("DELETE(.+)folders").
WillReturnResult(sqlmock.NewResult(0, 3))
mock.ExpectCommit()