-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Showing
5 changed files
with
35 additions
and
28 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
4 changes: 2 additions & 2 deletions
4
custom_components/hacs/helpers/properties/can_be_installed.py
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,28 +1,28 @@ | ||
"""Helpers: Misc: version_left_higher_then_right.""" | ||
"""Helpers: Misc: version_left_higher_or_equal_then_right.""" | ||
# pylint: disable=missing-docstring | ||
from custom_components.hacs.helpers.functions.misc import version_left_higher_then_right | ||
from custom_components.hacs.utils.version import version_left_higher_or_equal_then_right | ||
|
||
|
||
def test_basic(): | ||
assert version_left_higher_then_right("1.0.0", "0.9.9") | ||
assert version_left_higher_then_right("1", "0.9.9") | ||
assert version_left_higher_then_right("1.1", "0.9.9") | ||
assert version_left_higher_then_right("0.10.0", "0.9.9") | ||
assert not version_left_higher_then_right("0.0.10", "0.9.9") | ||
assert not version_left_higher_then_right("0.9.0", "0.9.9") | ||
assert version_left_higher_then_right("1.0.0", "1.0.0") | ||
assert version_left_higher_or_equal_then_right("1.0.0", "0.9.9") | ||
assert version_left_higher_or_equal_then_right("1", "0.9.9") | ||
assert version_left_higher_or_equal_then_right("1.1", "0.9.9") | ||
assert version_left_higher_or_equal_then_right("0.10.0", "0.9.9") | ||
assert not version_left_higher_or_equal_then_right("0.0.10", "0.9.9") | ||
assert not version_left_higher_or_equal_then_right("0.9.0", "0.9.9") | ||
assert version_left_higher_or_equal_then_right("1.0.0", "1.0.0") | ||
|
||
|
||
def test_beta(): | ||
assert version_left_higher_then_right("1.0.0b1", "1.0.0b0") | ||
assert not version_left_higher_then_right("1.0.0b1", "1.0.0") | ||
assert version_left_higher_then_right("1.0.0", "1.0.0b1") | ||
assert version_left_higher_or_equal_then_right("1.0.0b1", "1.0.0b0") | ||
assert not version_left_higher_or_equal_then_right("1.0.0b1", "1.0.0") | ||
assert version_left_higher_or_equal_then_right("1.0.0", "1.0.0b1") | ||
|
||
|
||
def test_wierd_stuff(): | ||
assert version_left_higher_then_right("1.0.0rc1", "1.0.0b1") | ||
assert not version_left_higher_then_right("1.0.0a1", "1.0.0b1") | ||
assert version_left_higher_then_right("1.0.0", "1.0.0a0") | ||
assert version_left_higher_then_right("1.0.0", "1.0.0b0") | ||
assert version_left_higher_then_right("1.0.0", "1.0.0rc0") | ||
assert not version_left_higher_then_right("0", "1.0.0rc0") | ||
assert version_left_higher_or_equal_then_right("1.0.0rc1", "1.0.0b1") | ||
assert not version_left_higher_or_equal_then_right("1.0.0a1", "1.0.0b1") | ||
assert version_left_higher_or_equal_then_right("1.0.0", "1.0.0a0") | ||
assert version_left_higher_or_equal_then_right("1.0.0", "1.0.0b0") | ||
assert version_left_higher_or_equal_then_right("1.0.0", "1.0.0rc0") | ||
assert not version_left_higher_or_equal_then_right("0", "1.0.0rc0") |