Skip to content

Commit

Permalink
chore(python-provider): add test without errorCode in response (#2056)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Poignant <[email protected]>
  • Loading branch information
thomaspoignant committed Aug 16, 2024
1 parent 3fc78d8 commit 30e21dc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"trackEvents": true,
"variationType": "True",
"failed": false,
"version": "1.0.0",
"reason": "TARGETING_MATCH",
"value": true,
"metadata": {"test": "test1", "test2": false, "test3": 123.3},
"cacheable": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,25 @@ def test_should_resolve_a_valid_boolean_flag_with_targeting_match_reason(mock_re
assert res == want


@patch("urllib3.poolmanager.PoolManager.request")
def test_should_resolve_a_valid_boolean_flag_with_targeting_match_reason_without_error_code(
mock_request,
):
flag_key = "bool_targeting_match_no_error_field"
default_value = False
res = _generic_test(
mock_request, flag_key, default_value, _default_evaluation_ctx, "bool"
)
want: FlagEvaluationDetails = FlagEvaluationDetails(
flag_key=flag_key,
value=True,
variant="True",
reason=Reason.TARGETING_MATCH,
flag_metadata={"test": "test1", "test2": False, "test3": 123.3},
)
assert res == want


@patch("urllib3.poolmanager.PoolManager.request")
def test_should_return_custom_reason_if_returned_by_relay_proxy(mock_request):
flag_key = "unknown_reason"
Expand Down

0 comments on commit 30e21dc

Please sign in to comment.