Initial commit
This commit is contained in:
20
tests/test_cli.py
Normal file
20
tests/test_cli.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import pytest
|
||||
from redmine_reporter.cli import parse_date_range
|
||||
|
||||
|
||||
def test_parse_date_range_valid():
|
||||
assert parse_date_range("2025-01-01--2025-12-31") == ("2025-01-01", "2025-12-31")
|
||||
|
||||
|
||||
def test_parse_date_range_with_spaces():
|
||||
assert parse_date_range("2025-01-01 -- 2025-12-31") == ("2025-01-01", "2025-12-31")
|
||||
|
||||
|
||||
def test_parse_date_range_invalid_no_separator():
|
||||
with pytest.raises(ValueError, match="must be in format"):
|
||||
parse_date_range("2025-01-01")
|
||||
|
||||
|
||||
def test_parse_date_range_invalid_parts():
|
||||
with pytest.raises(ValueError, match="Invalid date range format"):
|
||||
parse_date_range("2025-01-01--")
|
||||
Reference in New Issue
Block a user