From 355849e004c7c78f81b32203ebd8405264d3b0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D0=BA=D0=BE=D1=81=20=D0=90=D1=80=D1=82=D0=B5?= =?UTF-8?q?=D0=BC=20=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B5=D0=B2=D0=B8?= =?UTF-8?q?=D1=87?= Date: Mon, 26 Jan 2026 12:37:57 +0700 Subject: [PATCH] Fix issue mock for tests --- redmine_reporter/config.py | 2 +- tests/test_report_builder.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/redmine_reporter/config.py b/redmine_reporter/config.py index e029256..28872fe 100644 --- a/redmine_reporter/config.py +++ b/redmine_reporter/config.py @@ -6,7 +6,7 @@ load_dotenv() class Config: - REDMINE_URL = os.getenv("REDMINE_URL", "").rstrip("/") + REDMINE_URL = os.getenv("REDMINE_URL", "").strip().rstrip("/") REDMINE_USER = os.getenv("REDMINE_USER") REDMINE_PASSWORD = os.getenv("REDMINE_PASSWORD") REDMINE_AUTHOR = os.getenv("REDMINE_AUTHOR") diff --git a/tests/test_report_builder.py b/tests/test_report_builder.py index 5de4b03..6622be5 100644 --- a/tests/test_report_builder.py +++ b/tests/test_report_builder.py @@ -4,7 +4,8 @@ from redmine_reporter.utils import get_version class MockIssue: - def __init__(self, project, subject, status, fixed_version=None): + def __init__(self, project, subject, status, fixed_version=None, issue_id=999): + self.id = issue_id self.project = project self.subject = subject self.status = status @@ -21,9 +22,9 @@ def test_status_translation(): def test_build_grouped_report(): issues = [ - (MockIssue("Камеры", "Фича A", "New", "v2.5.0"), 2.0), - (MockIssue("Камеры", "Баг B", "Resolved", "v2.5.0"), 1.5), - (MockIssue("ПО", "Доки", "Pending", None), 4.0), + (MockIssue("Камеры", "Фича A", "New", "v2.5.0", 101), 2.0), + (MockIssue("Камеры", "Баг B", "Resolved", "v2.5.0", 102), 1.5), + (MockIssue("ПО", "Доки", "Pending", None, 201), 4.0), ] rows = build_grouped_report(issues)