-
Notifications
You must be signed in to change notification settings - Fork 1
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
4ec7c14
commit 27cde0f
Showing
3 changed files
with
3 additions
and
18 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 |
---|---|---|
@@ -1,28 +1,15 @@ | ||
import pytest | ||
|
||
from sitreps_client.code_coverage import CodecovCoverage | ||
from sitreps_client.exceptions import CodeCoverageError | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"slug", ["digitronik/varmeth", "digitronik/wrong"], ids=["correct", "wrong"] | ||
) | ||
def test_code_coverage_is_available(slug): | ||
codecov = CodecovCoverage(repo_slug=slug, branch="master") | ||
def test_code_coverage(slug): | ||
codecov = CodecovCoverage(repo_slug=slug) | ||
|
||
if "wrong" in slug: | ||
assert not codecov.is_available | ||
assert not codecov.get_coverage() | ||
else: | ||
assert codecov.is_available | ||
|
||
|
||
@pytest.mark.parametrize("branch", ["master", "foo"], ids=["correct", "wrong"]) | ||
def test_code_coverage_branch(branch): | ||
codecov = CodecovCoverage(repo_slug="digitronik/varmeth", branch=branch) | ||
|
||
if branch == "master": | ||
assert codecov.get_coverage() | ||
else: | ||
with pytest.raises(CodeCoverageError) as error: | ||
codecov.get_coverage() | ||
assert "Branch not found" in str(error.value) |
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