-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ee5c55
commit f814312
Showing
4 changed files
with
57 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from scripts.poetry_scripts import ( | ||
check_coverage, | ||
coverage_report, | ||
coverage_xml, | ||
generate_requirements, | ||
go_docker, | ||
) | ||
|
||
|
||
def test_go_docker(mocker): | ||
"""Test go_docker function from scripts.poetry_scripts""" | ||
mocked_function = mocker.patch("os.system") | ||
go_docker() | ||
mocked_function.assert_called_once_with("docker-compose up -d") | ||
|
||
|
||
def test_coverage_report(mocker): | ||
"""Test coverage_report function from scripts.poetry_scripts""" | ||
mocked_function = mocker.patch("os.system") | ||
coverage_report() | ||
mocked_function.assert_called_once_with("coverage run -m py.test") | ||
|
||
|
||
def test_coverage_xml(mocker): | ||
"""Test coverage_xml function from scripts.poetry_scripts""" | ||
mocked_function = mocker.patch("os.system") | ||
coverage_xml() | ||
mocked_function.assert_called_once_with("coverage xml") | ||
|
||
|
||
def test_check_coverage(mocker): | ||
"""Test check_coverage function from scripts.poetry_scripts""" | ||
mocked_function = mocker.patch("os.system") | ||
check_coverage() | ||
mocked_function.assert_called_once_with("coverage report --fail-under=95") | ||
|
||
|
||
def test_generate_requirements(mocker): | ||
"""Test check_coverage function from scripts.poetry_scripts""" | ||
mocked_function = mocker.patch("os.system") | ||
generate_requirements() | ||
mocked_function.assert_called_once_with( | ||
"poetry export -f requirements.txt > requirements.txt" | ||
) |