|
4 | 4 | import httpx |
5 | 5 | import threading |
6 | 6 | from unittest.mock import Mock, patch |
7 | | -from typing import Any, Dict, Optional, List |
| 7 | +from typing import Dict, Optional, List |
8 | 8 | from itertools import chain, repeat |
9 | 9 | from .types import LocalFlagsConfig, ExperimentationFlag, RuleSet, Variant, Rollout, FlagTestUsers, ExperimentationFlags, VariantOverride, SelectedVariant |
10 | 10 | from .local_feature_flags import LocalFeatureFlagsProvider |
@@ -222,20 +222,19 @@ async def test_get_variant_value_respects_runtime_evaluation_rule_not_satisfied( |
222 | 222 | } |
223 | 223 | result = self._flags.get_variant_value(TEST_FLAG_KEY, "fallback", context) |
224 | 224 | assert result == "fallback" |
225 | | - |
226 | | - def user_context_with_properties(self, properties: Dict[str, Any]) -> Dict[str, Any]: |
227 | | - context = {"distinct_id": DISTINCT_ID, "custom_properties": properties} |
228 | | - return context |
229 | 225 |
|
230 | 226 | @respx.mock |
231 | 227 | async def test_get_variant_value_respects_runtime_evaluation_satisfied(self): |
232 | 228 | runtime_eval = {"plan": "premium", "region": "US"} |
233 | 229 | flag = create_test_flag(runtime_evaluation_legacy_definition=runtime_eval) |
234 | 230 | await self.setup_flags([flag]) |
235 | | - context = self.user_context_with_properties({ |
236 | | - "plan": "premium", |
237 | | - "region": "US" |
238 | | - }) |
| 231 | + context = { |
| 232 | + "distinct_id": DISTINCT_ID, |
| 233 | + "custom_properties": { |
| 234 | + "plan": "premium", |
| 235 | + "region": "US" |
| 236 | + } |
| 237 | + } |
239 | 238 | result = self._flags.get_variant_value(TEST_FLAG_KEY, "fallback", context) |
240 | 239 | assert result != "fallback" |
241 | 240 |
|
|
0 commit comments