From 8c9bf2559a797fefef3f3928726ce28e7d9b6ac5 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Mon, 15 Apr 2024 13:39:55 -0500 Subject: [PATCH] add back details --- test/io/test_io.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/test/io/test_io.py b/test/io/test_io.py index ad9966eb0f..ab51cbaf5a 100644 --- a/test/io/test_io.py +++ b/test/io/test_io.py @@ -797,16 +797,34 @@ def test_log_level(level, defaultenv): if level == "crit": assert len(output) == 0 elif level == "error": - assert '"GET / HTTP/1.1" 500' in output[0] + assert re.match( + r'- - - \[.+\] "GET / HTTP/1.1" 500 - "" "python-requests/.+"', + output[0], + ) assert len(output) == 1 elif level == "warn": - assert '"GET / HTTP/1.1" 500' in output[0] - assert '"GET /unknown HTTP/1.1" 404' in output[1] + assert re.match( + r'- - - \[.+\] "GET / HTTP/1.1" 500 - "" "python-requests/.+"', + output[0], + ) + assert re.match( + r'- - postgrest_test_anonymous \[.+\] "GET /unknown HTTP/1.1" 404 - "" "python-requests/.+"', + output[1], + ) assert len(output) == 2 else: - assert '"GET / HTTP/1.1" 500' in output[0] - assert '"GET / HTTP/1.1" 200' in output[1] - assert '"GET /unknown HTTP/1.1" 404' in output[2] + assert re.match( + r'- - - \[.+\] "GET / HTTP/1.1" 500 - "" "python-requests/.+"', + output[0], + ) + assert re.match( + r'- - postgrest_test_anonymous \[.+\] "GET / HTTP/1.1" 200 - "" "python-requests/.+"', + output[1], + ) + assert re.match( + r'- - postgrest_test_anonymous \[.+\] "GET /unknown HTTP/1.1" 404 - "" "python-requests/.+"', + output[2], + ) assert len(output) == 3