Add Redmine API token authentication

This commit is contained in:
Кокос Артем Николаевич
2026-05-22 17:18:30 +07:00
parent 7bc6e024c0
commit 8bc8181ce3
14 changed files with 190 additions and 43 deletions

View File

@@ -1,5 +1,4 @@
import sys
import pytest
from io import StringIO
from unittest import mock
from redmine_reporter.cli import main
@@ -14,6 +13,7 @@ from redmine_reporter.config import Config
@mock.patch.multiple(
Config,
REDMINE_URL="https://red.eltex.loc",
REDMINE_API_KEY=None,
REDMINE_USER="x",
REDMINE_PASSWORD="y",
)
@@ -34,6 +34,7 @@ def test_cli_smoke_empty(mock_fetch):
@mock.patch.multiple(
Config,
REDMINE_URL="https://red.eltex.loc",
REDMINE_API_KEY=None,
REDMINE_USER="x",
REDMINE_PASSWORD="y",
)
@@ -48,6 +49,7 @@ def test_cli_returns_zero_on_no_entries(mock_fetch):
@mock.patch.multiple(
Config,
REDMINE_URL="",
REDMINE_API_KEY=None,
REDMINE_USER=None,
REDMINE_PASSWORD=None,
)
@@ -66,6 +68,7 @@ def test_cli_invalid_date_format():
@mock.patch.multiple(
Config,
REDMINE_URL="https://red.eltex.loc",
REDMINE_API_KEY=None,
REDMINE_USER="x",
REDMINE_PASSWORD="y",
)
@@ -81,6 +84,7 @@ def test_cli_unknown_output_extension(mock_fetch, tmp_path):
@mock.patch.multiple(
Config,
REDMINE_URL="https://red.eltex.loc",
REDMINE_API_KEY=None,
REDMINE_USER="x",
REDMINE_PASSWORD="y",
)