File tree 2 files changed +3
-20
lines changed
2 files changed +3
-20
lines changed Original file line number Diff line number Diff line change 3
3
from numbers import Number
4
4
5
5
from open_feature .evaluation_context .evaluation_context import EvaluationContext
6
- from open_feature .exception .exceptions import GeneralError , OpenFeatureError
6
+ from open_feature .exception .exceptions import OpenFeatureError
7
7
from open_feature .flag_evaluation .error_code import ErrorCode
8
8
from open_feature .flag_evaluation .flag_evaluation_details import FlagEvaluationDetails
9
9
from open_feature .flag_evaluation .flag_type import FlagType
@@ -274,9 +274,6 @@ def _create_provider_evaluation(
274
274
FlagType .NUMBER : self .provider .get_number_details ,
275
275
FlagType .OBJECT : self .provider .get_object_details ,
276
276
FlagType .STRING : self .provider .get_string_details ,
277
- }.get (flag_type )
278
-
279
- if not get_details_callable :
280
- raise GeneralError (error_message = "Unknown flag type" )
277
+ }[flag_type ]
281
278
282
279
return get_details_callable (* args )
Original file line number Diff line number Diff line change 3
3
4
4
import pytest
5
5
6
- from open_feature .exception .exceptions import GeneralError , OpenFeatureError
6
+ from open_feature .exception .exceptions import OpenFeatureError
7
7
from open_feature .flag_evaluation .error_code import ErrorCode
8
8
from open_feature .flag_evaluation .reason import Reason
9
9
from open_feature .hooks .hook import Hook
10
- from open_feature .open_feature_client import OpenFeatureClient
11
10
12
11
13
12
@pytest .mark .parametrize (
@@ -72,19 +71,6 @@ def test_should_get_flag_detail_based_on_method_type(
72
71
assert isinstance (flag .value , flag_type )
73
72
74
73
75
- def test_should_raise_exception_when_invalid_flag_type_provided ():
76
- # Given
77
- # When
78
- with pytest .raises (GeneralError ) as ge :
79
- OpenFeatureClient ("No provider" , "1.0" )._create_provider_evaluation (
80
- flag_type = None , flag_key = "Key" , default_value = True
81
- )
82
- # Then
83
- assert ge .value
84
- assert ge .value .error_message == "Unknown flag type"
85
- assert ge .value .error_code == ErrorCode .GENERAL
86
-
87
-
88
74
def test_should_handle_a_generic_exception_thrown_by_a_provider (no_op_provider_client ):
89
75
# Given
90
76
exception_hook = MagicMock (spec = Hook )
You can’t perform that action at this time.
0 commit comments