Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(python-provider): add test without errorCode in response #2056

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading