Fix: failed test due to modifications

This commit is contained in:
HFO4
2020-02-27 15:34:16 +08:00
parent c4eada2723
commit 2f1f619f2f
5 changed files with 101 additions and 10 deletions

View File

@@ -63,14 +63,6 @@ func TestDownload_AfterFind(t *testing.T) {
asserts.Equal("", download.StatusInfo.Gid)
}
// 关联任务
{
mock.ExpectQuery("SELECT(.+)").WillReturnRows(sqlmock.NewRows([]string{"id", "error"}).AddRow(1, "error"))
download := Download{TaskID: 1}
download.BeforeSave()
asserts.NoError(mock.ExpectationsWereMet())
asserts.Equal("error", download.Task.Error)
}
}
func TestDownload_Save(t *testing.T) {