Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix off-by-one error in version parsing function msg. #286

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pins/tests/test_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ def test_version_from_string():
assert version.hash == "baf3f"


def test_version_from_string_too_many_hyphens():
with pytest.raises(
PinsVersionError, match="version string can only have 1 '-', but contains 2"
):
Version.from_string("20220209T220116Z-baf3f-")


def test_version_from_string_too_few_hyphens():
with pytest.raises(
PinsVersionError, match="version string can only have 1 '-', but contains 0"
):
Version.from_string("20220209T220116Zbaf3f")
isabelizimm marked this conversation as resolved.
Show resolved Hide resolved


def test_version_from_string_baddate():
with pytest.raises(PinsVersionError, match="Invalid date part of version: bug"):
Version.from_string("bug-baf3f")
Expand Down
Loading