Skip to content

Commit fd3034f

Browse files
authored
FFM-5991 Make IN operator case sensitive (#53)
* FFM-5991 Make IN operator case sensitive * FFM-5991 Test case for case sensitive in_list
1 parent 213642e commit fd3034f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

featureflags/ftypes/string.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ def less_than_equal(self, value: typing.Any) -> bool:
5454
return self.value.lower() <= _value.lower()
5555

5656
def in_list(self, value: typing.List[typing.Any]) -> bool:
57-
return self.value.lower() in (val.lower() for val in value)
57+
return self.value in value

tests/unit/test_string.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
],
2121
)
2222
def test_type_methods(mocker, arg, input, mocked, method, expected):
23-
2423
m = mocker.patch("featureflags.ftypes.string.get_str_value",
2524
return_value=mocked)
2625
_string = String(value=arg)
@@ -33,11 +32,19 @@ def test_type_methods(mocker, arg, input, mocked, method, expected):
3332
m.assert_called_with(input)
3433

3534

36-
def test_in_list():
35+
def test_in_list_match():
36+
_string = String(value="Harness")
37+
38+
got = _string.in_list(["wings", "Harness"])
39+
expected = True
3740

38-
_string = String(value="harness")
41+
assert got == expected
42+
43+
44+
def test_in_list_no_match():
45+
_string = String(value="Harness")
3946

4047
got = _string.in_list(["wings", "harness"])
41-
expected = True
48+
expected = False
4249

4350
assert got == expected

0 commit comments

Comments
 (0)