-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from capitalone/dev
Release 2022.6.0
- Loading branch information
Showing
8 changed files
with
63 additions
and
24 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 was deleted.
Oops, something went wrong.
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,43 @@ | ||
from unittest.mock import patch | ||
|
||
import pytest | ||
|
||
from edgetest.core import TestPackage | ||
from edgetest.report import gen_report | ||
|
||
|
||
@patch("edgetest.report.tabulate", autospec=True) | ||
@patch("edgetest.core.TestPackage.upgraded_packages", autospec=True) | ||
def test_report(mock_test_package, mock_tabulate, plugin_manager): | ||
"""Test gen_report function""" | ||
|
||
tester_list = [ | ||
TestPackage(hook=plugin_manager.hook, envname="myenv", upgrade=["myupgrade1"]), | ||
TestPackage(hook=plugin_manager.hook, envname="myenv", upgrade=["myupgrade2"]), | ||
] | ||
gen_report(tester_list) | ||
mock_tabulate.assert_called_with( | ||
[], | ||
headers=[ | ||
"Environment", | ||
"Passing tests", | ||
"Upgraded packages", | ||
"Package version", | ||
], | ||
tablefmt="rst", | ||
) | ||
|
||
gen_report(tester_list, output_type="github") | ||
mock_tabulate.assert_called_with( | ||
[], | ||
headers=[ | ||
"Environment", | ||
"Passing tests", | ||
"Upgraded packages", | ||
"Package version", | ||
], | ||
tablefmt="github", | ||
) | ||
|
||
with pytest.raises(ValueError) as e: | ||
gen_report(tester_list, output_type="bad") |