Skip to content

Commit 48c7462

Browse files
authored
Migrate Redis LiveTests to recordings (#1368)
1 parent 00bbf76 commit 48c7462

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.LiveTests/RedisCommandTests.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,31 @@
44
using System.Text.Json;
55
using Azure.Mcp.Tests;
66
using Azure.Mcp.Tests.Client;
7+
using Azure.Mcp.Tests.Client.Helpers;
8+
using Azure.Mcp.Tests.Generated.Models;
79
using Xunit;
810

911
namespace Azure.Mcp.Tools.Redis.LiveTests;
1012

11-
public class RedisCommandTests(ITestOutputHelper output) : CommandTestsBase(output)
13+
public class RedisCommandTests(ITestOutputHelper output, TestProxyFixture fixture) : RecordedCommandTestsBase(output, fixture)
1214
{
15+
public override List<BodyKeySanitizer> BodyKeySanitizers { get; } = new List<BodyKeySanitizer>
16+
{
17+
new(new BodyKeySanitizerBody("$..displayName")
18+
{
19+
Value = "Sanitized"
20+
}),
21+
};
22+
23+
public override List<BodyRegexSanitizer> BodyRegexSanitizers => new()
24+
{
25+
new BodyRegexSanitizer(new BodyRegexSanitizerBody() {
26+
Regex = "\"domains\"\\s*:\\s*\\[(?s)(?<domains>.*?)\\]",
27+
GroupForReplace = "domains",
28+
Value = "\"contoso.com\""
29+
})
30+
};
31+
1332
[Fact]
1433
public async Task Should_list_redis_caches_by_subscription_id()
1534
{
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"AssetsRepo": "Azure/azure-sdk-assets",
3+
"AssetsRepoPrefixPath": "",
4+
"TagPrefix": "Azure.Mcp.Tools.Redis.LiveTests",
5+
"Tag": "Azure.Mcp.Tools.Redis.LiveTests_de964506f0"
6+
}

0 commit comments

Comments
 (0)