From 2eccaae2af5fdb86252d88aaf72b2b9f43eb0de9 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Mon, 2 Feb 2026 10:11:08 +0000 Subject: [PATCH] Add test files (unit and integration tests) --- tests/integration/test_end_to_end.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/integration/test_end_to_end.py b/tests/integration/test_end_to_end.py index bb51c75..b89eb8d 100644 --- a/tests/integration/test_end_to_end.py +++ b/tests/integration/test_end_to_end.py @@ -1,13 +1,8 @@ """Integration tests for LogLens.""" -import pytest -import tempfile -from pathlib import Path - -from loglens.parsers.base import LogFormat from loglens.analyzers.analyzer import LogAnalyzer -from loglens.formatters.table_formatter import TableFormatter from loglens.formatters.json_formatter import JSONFormatter +from loglens.parsers.base import LogFormat class TestEndToEnd: @@ -48,10 +43,10 @@ Jan 15 10:30:02 server-01 app[1234]: WARNING: High memory usage def test_apache_file_analysis(self, tmp_path): """Test complete Apache file analysis.""" - log_content = '''192.168.1.1 - - [15/Jan/2024:10:30:00 +0000] "GET /api/users HTTP/1.1" 200 1234 + log_content = """192.168.1.1 - - [15/Jan/2024:10:30:00 +0000] "GET /api/users HTTP/1.1" 200 1234 192.168.1.2 - - [15/Jan/2024:10:30:01 +0000] "POST /api/login HTTP/1.1" 401 567 192.168.1.3 - - [15/Jan/2024:10:30:02 +0000] "GET /api/orders HTTP/1.1" 500 4321 -''' +""" log_file = tmp_path / "apache.log" log_file.write_text(log_content)