Skip to content

Commit 06acf6e

Browse files
Revert "helper to build context with runtime data"
This reverts commit 651700d.
1 parent 5f1468b commit 06acf6e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

‎mixpanel/flags/test_local_feature_flags.py‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import httpx
55
import threading
66
from unittest.mock import Mock, patch
7-
from typing import Any, Dict, Optional, List
7+
from typing import Dict, Optional, List
88
from itertools import chain, repeat
99
from .types import LocalFlagsConfig, ExperimentationFlag, RuleSet, Variant, Rollout, FlagTestUsers, ExperimentationFlags, VariantOverride, SelectedVariant
1010
from .local_feature_flags import LocalFeatureFlagsProvider
@@ -222,20 +222,19 @@ async def test_get_variant_value_respects_runtime_evaluation_rule_not_satisfied(
222222
}
223223
result = self._flags.get_variant_value(TEST_FLAG_KEY, "fallback", context)
224224
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
229225

230226
@respx.mock
231227
async def test_get_variant_value_respects_runtime_evaluation_satisfied(self):
232228
runtime_eval = {"plan": "premium", "region": "US"}
233229
flag = create_test_flag(runtime_evaluation_legacy_definition=runtime_eval)
234230
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+
}
239238
result = self._flags.get_variant_value(TEST_FLAG_KEY, "fallback", context)
240239
assert result != "fallback"
241240

0 commit comments

Comments
 (0)