Skip to content

Commit 2bb5c0b

Browse files
author
Bilal Al
committed
merged changes from greater and less than matchers
1 parent a2257b7 commit 2bb5c0b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test=pytest
1313

1414
[tool:pytest]
1515
ignore_glob=./splitio/_OLD/*
16-
addopts = --verbose --cov=splitio --cov-report xml
16+
addopts = --verbose --cov=splitio --cov-report xml -k BetweenSemverMatcherTests
1717
python_classes=*Tests
1818

1919
[build_sphinx]

splitio/models/grammar/matchers/semver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def _match(self, key, attributes=None, context=None):
223223
if matching_data is None:
224224
return False
225225

226-
return self._semver.compare(Semver(matching_data)) in [0, 1]
226+
return Semver(matching_data).compare(self._semver) in [0, 1]
227227

228228
def __str__(self):
229229
"""Return string Representation."""
@@ -268,7 +268,7 @@ def _match(self, key, attributes=None, context=None):
268268
if matching_data is None:
269269
return False
270270

271-
return self._semver.compare(Semver(matching_data)) in [0, -1]
271+
return Semver(matching_data).compare(self._semver) in [0, -1]
272272

273273
def __str__(self):
274274
"""Return string Representation."""

tests/models/grammar/test_matchers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -950,9 +950,9 @@ def test_matcher_behaviour(self, mocker):
950950
parsed = matchers.from_raw(self.raw)
951951
assert parsed._match("2.1.8+rc")
952952
assert parsed._match("2.1.8")
953-
assert not parsed._match("2.1.11")
954-
assert parsed._match("2.1.5")
955-
assert parsed._match("2.1.5-rc1")
953+
assert parsed._match("2.1.11")
954+
assert not parsed._match("2.1.5")
955+
assert not parsed._match("2.1.5-rc1")
956956

957957
def test_to_json(self):
958958
"""Test that the object serializes to JSON properly."""
@@ -990,9 +990,9 @@ def test_matcher_behaviour(self, mocker):
990990
parsed = matchers.from_raw(self.raw)
991991
assert parsed._match("2.1.8+rc")
992992
assert parsed._match("2.1.8")
993-
assert parsed._match("2.1.11")
994-
assert not parsed._match("2.1.5")
995-
assert not parsed._match("2.1.5-rc1")
993+
assert not parsed._match("2.1.11")
994+
assert parsed._match("2.1.5")
995+
assert parsed._match("2.1.5-rc1")
996996

997997
def test_to_json(self):
998998
"""Test that the object serializes to JSON properly."""

0 commit comments

Comments
 (0)