Skip to content

Commit 333919c

Browse files
committed
fix matcher and test
1 parent 98a6852 commit 333919c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

splitio/models/grammar/matchers/rule_based_segment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _match_dep_rb_segments(self, excluded_rb_segments, key, attributes, context)
6363
else:
6464
excluded_segment = context['ec'].rbs_segments.get(excluded_rb_segment.name)
6565
if key in excluded_segment.excluded.get_excluded_keys():
66-
return True
66+
return False
6767

6868
if self._match_dep_rb_segments(excluded_segment.excluded.get_excluded_segments(), key, attributes, context):
6969
return True

tests/engine/files/rule_base_segments2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"status": "ACTIVE",
3939
"trafficTypeName": "user",
4040
"excluded":{
41-
"keys":["bilal2"],
41+
"keys":["bilal2@split.io"],
4242
"segments":[]
4343
},
4444
"conditions": [

tests/engine/test_evaluator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ def test_using_rbs_in_excluded(self):
313313
assert e.eval_with_context('bilal@split.io', 'bilal@split.io', 'some', {'email': 'bilal@split.io'}, ctx)['treatment'] == "off"
314314
ctx = evaluation_facctory.context_for('bilal', ['some'])
315315
assert e.eval_with_context('bilal', 'bilal', 'some', {'email': 'bilal'}, ctx)['treatment'] == "on"
316-
ctx = evaluation_facctory.context_for('bilal2', ['some'])
317-
assert e.eval_with_context('bilal2', 'bilal2', 'some', {'email': 'bilal2'}, ctx)['treatment'] == "off"
316+
ctx = evaluation_facctory.context_for('bilal2@split.io', ['some'])
317+
assert e.eval_with_context('bilal2@split.io', 'bilal2@split.io', 'some', {'email': 'bilal2@split.io'}, ctx)['treatment'] == "on"
318318

319319
@pytest.mark.asyncio
320320
async def test_evaluate_treatment_with_rbs_in_condition_async(self):
@@ -385,8 +385,8 @@ async def test_using_rbs_in_excluded_async(self):
385385
assert e.eval_with_context('bilal@split.io', 'bilal@split.io', 'some', {'email': 'bilal@split.io'}, ctx)['treatment'] == "off"
386386
ctx = await evaluation_facctory.context_for('bilal', ['some'])
387387
assert e.eval_with_context('bilal', 'bilal', 'some', {'email': 'bilal'}, ctx)['treatment'] == "on"
388-
ctx = await evaluation_facctory.context_for('bilal2', ['some'])
389-
assert e.eval_with_context('bilal2', 'bilal2', 'some', {'email': 'bilal2'}, ctx)['treatment'] == "off"
388+
ctx = await evaluation_facctory.context_for('bilal2@split.io', ['some'])
389+
assert e.eval_with_context('bilal2@split.io', 'bilal2@split.io', 'some', {'email': 'bilal2@split.io'}, ctx)['treatment'] == "on"
390390

391391
class EvaluationDataFactoryTests(object):
392392
"""Test evaluation factory class."""

0 commit comments

Comments
 (0)