mirror of
				https://github.com/cloudreve/cloudreve.git
				synced 2025-11-01 00:57:15 +08:00 
			
		
		
		
	Fix: failed unit test due to update with callback
This commit is contained in:
		| @ -343,7 +343,7 @@ func TestHookChangeCapacity(t *testing.T) { | ||||
| 		ctx := context.WithValue(context.Background(), fsctx.FileModelCtx, oldFile) | ||||
| 		ctx = context.WithValue(ctx, fsctx.FileHeaderCtx, newFile) | ||||
| 		mock.ExpectBegin() | ||||
| 		mock.ExpectExec("UPDATE(.+)").WithArgs(1, 1).WillReturnResult(sqlmock.NewResult(1, 1)) | ||||
| 		mock.ExpectExec("UPDATE(.+)").WithArgs(1, sqlmock.AnyArg(), 1).WillReturnResult(sqlmock.NewResult(1, 1)) | ||||
| 		err := HookChangeCapacity(ctx, fs) | ||||
| 		asserts.NoError(mock.ExpectationsWereMet()) | ||||
| 		asserts.NoError(err) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 HFO4
					HFO4