This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using Ludarium.Api;
|
||||
|
||||
namespace Ludarium.E2E;
|
||||
|
||||
public sealed class RateLimitPolicyTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("GET", "/api/v1/games", "read", 1200)]
|
||||
[InlineData("POST", "/api/v1/games", "mutation", 120)]
|
||||
[InlineData("POST", "/api/v1/games/artwork/enrich", "expensive", 12)]
|
||||
[InlineData("POST", "/api/v1/games/metadata/enrich", "expensive", 12)]
|
||||
[InlineData("GET", "/api/v1/exports/inventory", "expensive", 12)]
|
||||
public void UsesSeparateStableBudgets(string method, string path, string expectedPartition, int expectedLimit)
|
||||
{
|
||||
var profile = ApiRateLimits.For(method, new(path));
|
||||
Assert.Equal(expectedPartition, profile.Partition);
|
||||
Assert.Equal(expectedLimit, profile.PermitLimit);
|
||||
Assert.Equal(TimeSpan.FromMinutes(1), profile.Window);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user