-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathversion_management_test.py
More file actions
27 lines (16 loc) · 993 Bytes
/
version_management_test.py
File metadata and controls
27 lines (16 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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(pkg_name="rainbow-server")
def test_if_find_latest_version_is_called_with_major_constraint_then_return_latest_major_version():
assert "1.5.3" == find_latest_version(pkg_name="pandas", major=1)
def test_if_pkg_does_not_exist_then_find_package_raises_exception():
with pytest.raises(Exception):
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=1)
assert result.stdout == "1.6.0\n"