Skip to content

Commit 9143a25

Browse files
author
Bilal Al
committed
polishing
1 parent 95068ed commit 9143a25

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

splitio/models/grammar/matchers/semver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def _match(self, key, attributes=None, context=None):
182182

183183
def __str__(self):
184184
"""Return string Representation."""
185-
return 'equal semver {self._data}'
185+
return 'equal semver {data}'.format(data=self._data)
186186

187187
def _add_matcher_specific_properties_to_json(self):
188188
"""Add matcher specific properties to base dict before returning it."""

tests/models/grammar/test_matchers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,3 +919,8 @@ def test_to_json(self):
919919
as_json = matchers.EqualToSemverMatcher(self.raw).to_json()
920920
assert as_json['matcherType'] == 'EQUAL_TO_SEMVER'
921921
assert as_json['stringMatcherData'] == "2.1.8"
922+
923+
def test_to_str(self):
924+
"""Test that the object serializes to str properly."""
925+
as_str = matchers.EqualToSemverMatcher(self.raw)
926+
assert str(as_str) == "equal semver 2.1.8"

0 commit comments

Comments
 (0)