File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,30 @@ async def test_get_variant_value_respects_runtime_evaluation_rule_not_satisfied(
213213 result = self ._flags .get_variant_value (TEST_FLAG_KEY , "fallback" , context )
214214 assert result == "fallback"
215215
216+ @respx .mock
217+ async def test_get_variant_value_invalid_runtime_rule_resorts_to_fallback (self ):
218+ runtime_eval = {
219+ "=oops=" : [{"var" : "plan" }, "premium" ]
220+ }
221+ flag = create_test_flag (runtime_evaluation_rule = runtime_eval )
222+ await self .setup_flags ([flag ])
223+ context = self .user_context_with_properties ({
224+ "plan" : "basic" ,
225+ })
226+ result = self ._flags .get_variant_value (TEST_FLAG_KEY , "fallback" , context )
227+ assert result == "fallback"
228+
229+ @respx .mock
230+ async def test_get_variant_value_respects_runtime_evaluation_rule_not_satisfied_when_no_custom_properties_provided (self ):
231+ runtime_eval = {
232+ "=" : [{"var" : "plan" }, "premium" ]
233+ }
234+ flag = create_test_flag (runtime_evaluation_rule = runtime_eval )
235+ await self .setup_flags ([flag ])
236+ context = self .user_context_with_properties ({})
237+ result = self ._flags .get_variant_value (TEST_FLAG_KEY , "fallback" , context )
238+ assert result == "fallback"
239+
216240 @respx .mock
217241 async def test_get_variant_value_respects_runtime_evaluation_rule_caseinsensitive_values__satisfied (self ):
218242 runtime_eval = {
You can’t perform that action at this time.
0 commit comments