-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve handling of missing component (#317)
* Improve handling of missing component * docstring
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Unit tests for the project.""" |
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,22 @@ | ||
"""Tests for the version builder.""" | ||
|
||
import re | ||
|
||
import pytest | ||
|
||
from ansible_dev_tools.version_builder import PKGS, version_builder | ||
|
||
|
||
def test_version_builder_success() -> None: | ||
"""Test the version builder.""" | ||
versions = version_builder() | ||
assert all(p in versions for p in PKGS) | ||
|
||
|
||
def test_version_builder_failure(monkeypatch: pytest.MonkeyPatch) -> None: | ||
"""Test the version builder.""" | ||
monkeypatch.setattr("ansible_dev_tools.version_builder.PKGS", ["__invalid__"]) | ||
|
||
versions = version_builder() | ||
|
||
assert re.search(r"__invalid__\s+not installed", versions) |