-
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.
- Loading branch information
1 parent
1a6ec88
commit 78c1a88
Showing
6 changed files
with
77 additions
and
10 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 |
---|---|---|
@@ -1,15 +1,27 @@ | ||
from test.cli_utilities import invoke_dac_next_version | ||
|
||
import pytest | ||
from dac._version_management import find_latest_version | ||
|
||
|
||
def test_if_find_latest_version_is_called_then_return_latest_version(): | ||
assert "0.5" == find_latest_version(library_name="rainbow-server") | ||
assert "0.5" == find_latest_version(pkg_name="rainbow-server") | ||
|
||
|
||
def test_if_find_latest_version_is_called_with_major_constraint_then_return_latest_major_version(): | ||
assert "0.25.3" == find_latest_version(library_name="pandas", major=0) | ||
assert "0.25.3" == find_latest_version(pkg_name="pandas", major=0) | ||
|
||
|
||
def test_if_pkg_does_not_exist_then_find_package_return_none(): | ||
def test_if_pkg_does_not_exist_then_find_package_raises_exception(): | ||
with pytest.raises(Exception): | ||
find_latest_version(library_name="non-existing-package") | ||
find_latest_version(pkg_name="non-existing-package") | ||
|
||
|
||
def test_if_next_version_without_major_spec_then_return_latest_version_with_minor_upgrade(): | ||
result = invoke_dac_next_version(pkg_name="rainbow-saddle") | ||
assert result.stdout == "0.5.0\n" | ||
|
||
|
||
def test_if_next_version_with_major_spec_then_return_minor_upgrade_for_that_major(): | ||
result = invoke_dac_next_version(pkg_name="pandas", major=0) | ||
assert result.stdout == "0.26.0\n" |
Empty file.
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,13 @@ | ||
import pytest | ||
from dac._version_management import increase_minor | ||
|
||
|
||
def test_increase_minor_then_return_version_with_increased_minor(): | ||
assert "0.6.0" == increase_minor(version="0.5.0") | ||
assert "0.6.0" == increase_minor(version="0.5.1rc0") | ||
|
||
|
||
@pytest.mark.parametrize("version", ["0", "0.5", "guess.what.now", "guess.0.now"]) | ||
def test_if_invalid_version_then_increase_minor_raises_exception(version): | ||
with pytest.raises(Exception): | ||
increase_minor(version=version) |