From 86e306047bdc17609e018c61dd055b97674ef01e Mon Sep 17 00:00:00 2001 From: "Scott Beddall (from Dev Box)" Date: Wed, 17 Apr 2024 15:18:29 -0700 Subject: [PATCH] actually fix the tests --- .../Azure.Sdk.Tools.TestProxy.Tests/LoggingTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/LoggingTests.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/LoggingTests.cs index 80e274d04a2..45c2e7f3361 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/LoggingTests.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/LoggingTests.cs @@ -52,7 +52,7 @@ public async Task PlaybackLogsSanitizedRequest() HttpResponse response = new DefaultHttpContext().Response; await testRecordingHandler.HandlePlaybackRequest(recordingId, request, response); - AssertLogs(logger, 4, 8); + AssertLogs(logger, 4, 8, 7); } finally { @@ -92,7 +92,7 @@ public async Task RecordingHandlerLogsSanitizedRequests() try { - AssertLogs(logger, 2, 8); + AssertLogs(logger, 2, 8, 12); } finally { @@ -101,7 +101,7 @@ public async Task RecordingHandlerLogsSanitizedRequests() } } - private static void AssertLogs(TestLogger logger, int offset, int expectedLength) + private static void AssertLogs(TestLogger logger, int offset, int expectedLength, int expectedContentLength) { Assert.Equal(expectedLength, logger.Logs.Count); Assert.Equal( @@ -118,7 +118,7 @@ private static void AssertLogs(TestLogger logger, int offset, int expectedLength logger.Logs[2 + offset].ToString()); Assert.Equal("URI: [ https://fakeazsdktestaccount.table.core.windows.net/Tables]" + Environment.NewLine + "Headers: [{\"Accept\":[\"application/json;odata=minimalmetadata\"],\"Accept-Encoding\":[\"gzip, deflate\"],\"Authorization\":[\"Sanitized\"],\"Connection\":[\"keep-alive\"]," + - "\"Content-Length\":[\"12\"],\"Content-Type\":[\"application/octet-stream\"],\"DataServiceVersion\":[\"3.0\"],\"Date\":[\"Tue, 18 May 2021 23:27:42 GMT\"]," + + "\"Content-Length\":[\"" + expectedContentLength + "\"],\"Content-Type\":[\"application/octet-stream\"],\"DataServiceVersion\":[\"3.0\"],\"Date\":[\"Tue, 18 May 2021 23:27:42 GMT\"]," + "\"User-Agent\":[\"azsdk-python-data-tables/12.0.0b7 Python/3.8.6 (Windows-10-10.0.19041-SP0)\"],\"x-ms-client-request-id\":[\"Sanitized\"]," + "\"x-ms-date\":[\"Tue, 18 May 2021 23:27:42 GMT\"],\"x-ms-version\":[\"2019-02-02\"]}]" + Environment.NewLine, logger.Logs[3 + offset].ToString());