-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add function to define latest released version on Jira project
- Loading branch information
atarutin
committed
May 8, 2024
1 parent
436e043
commit b994d1e
Showing
4 changed files
with
88 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
""" | ||
|
||
from unittest.mock import Mock | ||
import pytest | ||
from jira_utils import is_jira_hotfix_version | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"version_name", | ||
[ | ||
"hotfix-1.0.0", | ||
"1.0.0-hotfix", | ||
"1.0.0-hotfix-1", | ||
"1.0.0-hotfix-2", | ||
"1.0.0-hotfix-3", | ||
"1.0.0-HoTfIx-4", | ||
"hotfiX", | ||
], | ||
) | ||
def test_when_version_name_contains_hotfix(version_name): | ||
version = Mock() | ||
version.name = version_name | ||
assert is_jira_hotfix_version(version) |
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,19 @@ | ||
""" | ||
This module contains tests for the jira_utils module functions | ||
which are used to work with versions. | ||
""" | ||
|
||
from unittest.mock import Mock | ||
from jira_utils import is_jira_released_version | ||
|
||
|
||
def test_when_version_is_not_released(): | ||
version = Mock() | ||
version.released = False | ||
assert not is_jira_released_version(version) | ||
|
||
|
||
def test_when_version_is_released(): | ||
version = Mock() | ||
version.released = True | ||
assert is_jira_released_version(version) |