@@ -42,7 +42,7 @@ def test_get_variant(sentry_init, capture_events, uninstall_integration):
4242 uninstall_integration (UnleashIntegration )
4343 sentry_init (integrations = [UnleashIntegration ()])
4444
45- client .get_variant ("toggle_feature " )
45+ client .get_variant ("no_payload_feature " )
4646 client .get_variant ("string_feature" )
4747 client .get_variant ("json_feature" )
4848 client .get_variant ("csv_feature" )
@@ -55,7 +55,11 @@ def test_get_variant(sentry_init, capture_events, uninstall_integration):
5555 assert len (events ) == 1
5656 assert events [0 ]["contexts" ]["flags" ] == {
5757 "values" : [
58- {"flag" : "toggle_feature" , "result" : True },
58+ {"flag" : "no_payload_feature" , "result" : True },
59+ {"flag" : "string_feature" , "result" : True },
60+ {"flag" : "json_feature" , "result" : True },
61+ {"flag" : "csv_feature" , "result" : True },
62+ {"flag" : "number_feature" , "result" : True },
5963 {"flag" : "unknown_feature" , "result" : False },
6064 ]
6165 }
@@ -129,7 +133,7 @@ def task(flag_key):
129133 client .get_variant ("hello" )
130134
131135 with cf .ThreadPoolExecutor (max_workers = 2 ) as pool :
132- pool .map (task , ["other " , "toggle_feature " ])
136+ pool .map (task , ["no_payload_feature " , "other " ])
133137
134138 # Capture error in original scope
135139 sentry_sdk .set_tag ("task_id" , "0" )
@@ -146,13 +150,13 @@ def task(flag_key):
146150 assert events [1 ]["contexts" ]["flags" ] == {
147151 "values" : [
148152 {"flag" : "hello" , "result" : False },
149- {"flag" : "other " , "result" : False },
153+ {"flag" : "no_payload_feature " , "result" : True },
150154 ]
151155 }
152156 assert events [2 ]["contexts" ]["flags" ] == {
153157 "values" : [
154158 {"flag" : "hello" , "result" : False },
155- {"flag" : "toggle_feature " , "result" : True },
159+ {"flag" : "other " , "result" : False },
156160 ]
157161 }
158162
@@ -226,7 +230,7 @@ async def task(flag_key):
226230 sentry_sdk .capture_exception (Exception ("something wrong!" ))
227231
228232 async def runner ():
229- return asyncio .gather (task ("other " ), task ("toggle_feature " ))
233+ return asyncio .gather (task ("no_payload_feature " ), task ("other " ))
230234
231235 # Capture an eval before we split isolation scopes.
232236 client .get_variant ("hello" )
@@ -248,13 +252,13 @@ async def runner():
248252 assert events [1 ]["contexts" ]["flags" ] == {
249253 "values" : [
250254 {"flag" : "hello" , "result" : False },
251- {"flag" : "other " , "result" : False },
255+ {"flag" : "no_payload_feature " , "result" : True },
252256 ]
253257 }
254258 assert events [2 ]["contexts" ]["flags" ] == {
255259 "values" : [
256260 {"flag" : "hello" , "result" : False },
257- {"flag" : "toggle_feature " , "result" : True },
261+ {"flag" : "other " , "result" : False },
258262 ]
259263 }
260264
0 commit comments