-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add more tests to improve cover (#5)
- Loading branch information
Showing
13 changed files
with
494 additions
and
20 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import pytest | ||
|
||
from pdbstore.report import ReportGenerator | ||
|
||
|
||
def test_supported_list(tmp_store): | ||
"""test the list of supported report types""" | ||
report = ReportGenerator(tmp_store) | ||
assert sorted(report.supported_list()) == [ | ||
ReportGenerator.FILES, | ||
ReportGenerator.PRODUCTS, | ||
ReportGenerator.TRANSACTIONS, | ||
] | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"report_type", | ||
[ | ||
ReportGenerator.FILES, | ||
ReportGenerator.PRODUCTS, | ||
ReportGenerator.TRANSACTIONS, | ||
], | ||
) | ||
def test_valid_report(tmp_store, report_type): | ||
"""test report generation with success""" | ||
report = ReportGenerator(tmp_store) | ||
assert report.generate(report_type) is not None | ||
|
||
|
||
def test_invalid_report(tmp_store, capsys): | ||
"""test report generation with failure""" | ||
report = ReportGenerator(tmp_store) | ||
assert report.generate("invalid") is None | ||
assert capsys.readouterr().err == "ERROR: invalid : unsupported report type\n" |
Oops, something went wrong.