1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Remove no longer needed API call mocking

The online ID will be reset unconditionally after any local change is
made to any beatmap. That behaviour no longer depends on online lookups
succeeding or failing.

This may change at a later date when beatmap submission is integrated
into lazer - the idea is that online IDs would get re-populated on local
beatmaps once they are submitted to web.
This commit is contained in:
Bartłomiej Dach 2023-05-01 17:31:55 +02:00
parent f470b2c9cc
commit 1fb4c814f4
No known key found for this signature in database

View File

@ -2,20 +2,15 @@
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using System.Net;
using NUnit.Framework;
using osu.Framework.Extensions;
using osu.Game.Database;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Tests.Resources;
namespace osu.Game.Tests.Visual.Editing
{
public partial class TestSceneLocallyModifyingOnlineBeatmaps : EditorSavingTestScene
{
private DummyAPIAccess dummyAPI => (DummyAPIAccess)API;
public override void SetUpSteps()
{
CreateInitialBeatmap = () =>
@ -33,20 +28,6 @@ namespace osu.Game.Tests.Visual.Editing
AddAssert("editor beatmap has online ID", () => EditorBeatmap.BeatmapInfo.OnlineID, () => Is.GreaterThan(0));
AddStep("delete first hitobject", () => EditorBeatmap.RemoveAt(0));
AddStep("mock online lookup failure", () =>
{
dummyAPI.HandleRequest = req =>
{
if (req is GetBeatmapRequest)
{
req.TriggerFailure(new APIException("Beatmap not found", new WebException("NotFound")));
return true;
}
return false;
};
});
SaveEditor();
ReloadEditorToSameBeatmap();