-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert
ChangelogEntry.evr
to return an EVR
Also, adjust the EVR code to ensure that we don't match emails as EVRs Co-authored-by: Nikola Forró <[email protected]>
- Loading branch information
Showing
2 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,18 @@ | |
|
||
from specfile.changelog import Changelog, ChangelogEntry | ||
from specfile.sections import Section | ||
from specfile.utils import EVR | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"header, evr", | ||
"header, evr_str", | ||
[ | ||
("* Thu Jan 04 2007 Michael Schwendt <[email protected]>", None), | ||
("* Thu Jan 04 2007 Michael Schwendt <[email protected]>", None), | ||
( | ||
"* Fri Jul 26 2024 Miroslav Suchý <[email protected]> - ss981107-67", | ||
"ss981107-67", | ||
), | ||
( | ||
"* Mon Jul 13 2020 Tom Stellard <[email protected]> 4.0-0.4.pre2", | ||
"4.0-0.4.pre2", | ||
|
@@ -39,8 +45,12 @@ | |
), | ||
], | ||
) | ||
def test_entry_evr(header, evr): | ||
assert ChangelogEntry(header, [""]).evr == evr | ||
def test_entry_evr(header, evr_str): | ||
evr = ChangelogEntry(header, [""]).evr | ||
if evr_str: | ||
assert evr == EVR.from_string(evr_str) | ||
else: | ||
assert evr is None | ||
|
||
|
||
@pytest.mark.parametrize( | ||
|
@@ -133,7 +143,9 @@ def test_filter(since, until, evrs): | |
), | ||
] | ||
) | ||
assert [e.evr for e in changelog.filter(since=since, until=until)] == evrs | ||
assert [e.evr for e in changelog.filter(since=since, until=until)] == [ | ||
EVR.from_string(evr) for evr in evrs | ||
] | ||
|
||
|
||
def test_parse(): | ||
|