Skip to content

Commit ee5e7b6

Browse files
committed
fix: copilot review
Signed-off-by: Lea Konvalinka <lea.konvalinka@dynatrace.com>
1 parent 74d0e43 commit ee5e7b6

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

providers/openfeature-provider-flagd/tests/e2e/rpc/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"~operator-errors",
1515
"~semver-v-prefix",
1616
"~fractional-single-entry",
17+
"~semver-numeric-context",
1718
]
19+
# TODO remove last 4 tags when adjusted flagd is released
1820

1921

2022
def pytest_collection_modifyitems(config, items):

tools/openfeature-flagd-core/src/openfeature/contrib/tools/flagd/core/targeting/custom_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,6 @@ def normalize_version(arg: typing.Any) -> semver.Version:
180180
numeric_part = version.split("-")[0].split("+")[0]
181181
dot_count = numeric_part.count(".")
182182
if dot_count < 2:
183-
version = version + ".0" * (2 - dot_count)
183+
version = numeric_part + ".0" * (2 - dot_count) + version[len(numeric_part) :]
184184

185185
return semver.Version.parse(version)

tools/openfeature-flagd-core/tests/test_targeting.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_starts_with_no_args(self) -> None:
6666

6767
def test_starts_with_non_string(self) -> None:
6868
result = starts_with({}, 123, "abc")
69-
assert result is False
69+
assert result is None
7070

7171

7272
class TestEndsWith:
@@ -78,6 +78,10 @@ def test_ends_with_false(self) -> None:
7878
result = ends_with({}, "hello world", "hello")
7979
assert result is False
8080

81+
def test_ends_with_non_string(self) -> None:
82+
result = ends_with({}, 123, "abc")
83+
assert result is None
84+
8185

8286
class TestSemVer:
8387
def test_equal(self) -> None:

0 commit comments

Comments
 (0)