@@ -51,7 +51,7 @@ def setUp(self):
5151
5252 def test_returns_decision_from_cache_when_valid (self ):
5353 expected_key = self .cmab_service ._get_cache_key ("user123" , "exp1" )
54- expected_attributes = {"age " : 25 , "location " : "USA" }
54+ expected_attributes = {"66 " : 25 , "77 " : "USA" }
5555 expected_hash = self .cmab_service ._hash_attributes (expected_attributes )
5656
5757 self .mock_cmab_cache .lookup .return_value = {
@@ -70,7 +70,7 @@ def test_returns_decision_from_cache_when_valid(self):
7070
7171 def test_ignores_cache_when_option_given (self ):
7272 self .mock_cmab_client .fetch_decision .return_value = "varB"
73- expected_attributes = {"age " : 25 , "location " : "USA" }
73+ expected_attributes = {"66 " : 25 , "77 " : "USA" }
7474
7575 decision , _ = self .cmab_service .get_decision (
7676 self .mock_project_config ,
@@ -124,7 +124,7 @@ def test_new_decision_when_hash_changes(self):
124124 }
125125 self .mock_cmab_client .fetch_decision .return_value = "varE"
126126
127- expected_attribute = {"age " : 25 , "location " : "USA" }
127+ expected_attribute = {"66 " : 25 , "77 " : "USA" }
128128 expected_hash = self .cmab_service ._hash_attributes (expected_attribute )
129129 expected_key = self .cmab_service ._get_cache_key ("user123" , "exp1" )
130130
@@ -148,8 +148,8 @@ def test_new_decision_when_hash_changes(self):
148148
149149 def test_filter_attributes_returns_correct_subset (self ):
150150 filtered = self .cmab_service ._filter_attributes (self .mock_project_config , self .mock_user_context , "exp1" )
151- self .assertEqual (filtered ["age " ], 25 )
152- self .assertEqual (filtered ["location " ], "USA" )
151+ self .assertEqual (filtered ["66 " ], 25 )
152+ self .assertEqual (filtered ["77 " ], "USA" )
153153
154154 def test_filter_attributes_empty_when_no_cmab (self ):
155155 self .mock_project_config .experiment_id_map ["exp1" ].cmab = None
@@ -178,11 +178,10 @@ def test_only_cmab_attributes_passed_to_client(self):
178178 [OptimizelyDecideOption .IGNORE_CMAB_CACHE ]
179179 )
180180
181- # Verify only age and location are passed (attributes configured in setUp)
182181 self .mock_cmab_client .fetch_decision .assert_called_once_with (
183182 "exp1" ,
184183 self .mock_user_context .user_id ,
185- {"age " : 25 , "location " : "USA" },
184+ {"66 " : 25 , "77 " : "USA" },
186185 decision ["cmab_uuid" ]
187186 )
188187
0 commit comments