Skip to content

Commit b4dd2da

Browse files
committed
Adjust tests according to rebase
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent baa1aaf commit b4dd2da

5 files changed

Lines changed: 20 additions & 57 deletions

File tree

src/univers/versions.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ def __ge__(self, other):
592592
return isinstance(self.value, SemverVersion)
593593

594594

595-
@attr.s(frozen=True, order=False, eq=False, hash=True)
596595
class ConanVersion(Version):
597596
@classmethod
598597
def build_value(cls, string):
@@ -678,42 +677,6 @@ def next_patch(self):
678677
def bump(self, index):
679678
return self.value and self.value.bump(index)
680679

681-
def __eq__(self, other):
682-
if other is None:
683-
return False
684-
if not isinstance(other, ConanVersion):
685-
other = ConanVersion.build_value(other)
686-
return self.value == other
687-
return self.value == other.value
688-
689-
def __lt__(self, other):
690-
if other is None:
691-
return False
692-
if not isinstance(other, ConanVersion):
693-
other = ConanVersion(str(other))
694-
return self.value < other.value
695-
696-
def __le__(self, other):
697-
if other is None:
698-
return False
699-
if not isinstance(other, ConanVersion):
700-
other = ConanVersion(str(other))
701-
return self.value <= other.value
702-
703-
def __gt__(self, other):
704-
if other is None:
705-
return False
706-
if not isinstance(other, ConanVersion):
707-
other = ConanVersion(str(other))
708-
return self.value > other.value
709-
710-
def __ge__(self, other):
711-
if other is None:
712-
return False
713-
if not isinstance(other, ConanVersion):
714-
other = ConanVersion(str(other))
715-
return self.value >= other.value
716-
717680

718681
AVAILABLE_VERSIONS = [
719682
SemverVersion,

tests/data/conan_advisory.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,7 @@
24462446
"test_index": 350,
24472447
"scheme": "conan",
24482448
"native": ">=1.0.2 <=1.0.2v",
2449-
"expected_vers": "vers:conan/<=1.0.2|>=1.0.2",
2449+
"expected_vers": "vers:conan/>=1.0.2|<=1.0.2v",
24502450
"gitlab_scheme": "conan"
24512451
},
24522452
{

tests/data/openssl/openssl_versort_expected.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,6 @@
169169
"normalized_string": "0.9.8",
170170
"value": "0.9.8"
171171
},
172-
{
173-
"string": "0.9.8v",
174-
"normalized_string": "0.9.8",
175-
"value": "0.9.8"
176-
},
177172
{
178173
"string": "0.9.8a",
179174
"normalized_string": "0.9.8a",
@@ -279,6 +274,11 @@
279274
"normalized_string": "0.9.8u",
280275
"value": "0.9.8u"
281276
},
277+
{
278+
"string": "0.9.8v",
279+
"normalized_string": "0.9.8v",
280+
"value": "0.9.8v"
281+
},
282282
{
283283
"string": "0.9.8w",
284284
"normalized_string": "0.9.8w",
@@ -554,11 +554,6 @@
554554
"normalized_string": "1.0.2",
555555
"value": "1.0.2"
556556
},
557-
{
558-
"string": "1.0.2v",
559-
"normalized_string": "1.0.2",
560-
"value": "1.0.2"
561-
},
562557
{
563558
"string": "1.0.2a",
564559
"normalized_string": "1.0.2a",
@@ -664,6 +659,11 @@
664659
"normalized_string": "1.0.2u",
665660
"value": "1.0.2u"
666661
},
662+
{
663+
"string": "1.0.2v",
664+
"normalized_string": "1.0.2v",
665+
"value": "1.0.2v"
666+
},
667667
{
668668
"string": "1.0.2w",
669669
"normalized_string": "1.0.2w",
@@ -696,8 +696,8 @@
696696
},
697697
{
698698
"string": "1.0.2zc-dev",
699-
"normalized_string": "1.0.2zc-de",
700-
"value": "1.0.2zc-de"
699+
"normalized_string": "1.0.2zc-dev",
700+
"value": "1.0.2zc-dev"
701701
},
702702
{
703703
"string": "1.0.2zd",

tests/test_conan_version_comparison.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ def test_comparison(v1, v2):
6363
def test_comparison_with_integer():
6464
v1 = ConanVersion("13.0")
6565
# Issue: https://github.com/conan-io/conan/issues/12907
66-
assert v1 > 5
67-
assert v1 >= 5
68-
assert v1 < 20
69-
assert v1 <= 20
70-
assert v1 == 13
71-
assert v1 != 14
66+
assert v1 > ConanVersion("5")
67+
assert v1 >= ConanVersion("5")
68+
assert v1 < ConanVersion("20")
69+
assert v1 <= ConanVersion("20")
70+
assert v1 == ConanVersion("13")
71+
assert v1 != ConanVersion("14")
7272

7373

7474
e = [

tests/test_conan_version_range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_range(version_range, conditions, versions_in, versions_out):
5858
for condition_set, expected_condition_set in zip(r.condition_sets, conditions):
5959
for condition, expected_condition in zip(condition_set.conditions, expected_condition_set):
6060
assert condition.operator == expected_condition[0]
61-
assert condition.version == expected_condition[1]
61+
assert condition.version == ConanVersion(expected_condition[1])
6262

6363
for v in versions_in:
6464
assert ConanVersion(v) in r

0 commit comments

Comments
 (0)