File tree Expand file tree Collapse file tree
hooks/openfeature-hooks-opentelemetry/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66from openfeature .contrib .hook .opentelemetry import MetricsHook
77from openfeature .evaluation_context import EvaluationContext
8+ from openfeature .exception import FlagNotFoundError
89from openfeature .flag_evaluation import Reason
910from openfeature .hook import FlagEvaluationDetails , FlagType , HookContext
1011from openfeature .provider .metadata import Metadata
@@ -170,13 +171,13 @@ def test_metric_error(mock_get_meter):
170171 evaluation_context = EvaluationContext (),
171172 provider_metadata = Metadata (name = "test-provider" ),
172173 )
173- hook .error (hook_context , Exception ( "test error " ), hints = {})
174+ hook .error (hook_context , FlagNotFoundError ( "Flag not found: flag_key " ), hints = {})
174175 mock_counters ["feature_flag.evaluation.error_total" ].add .assert_called_once_with (
175176 1 ,
176177 {
177178 "feature_flag.key" : "flag_key" ,
178179 "feature_flag.provider.name" : "test-provider" ,
179- "exception" : "test error " ,
180+ "exception" : "flag not found: flag_key " ,
180181 },
181182 )
182183 mock_counters ["feature_flag.evaluation.success_total" ].add .assert_not_called ()
You can’t perform that action at this time.
0 commit comments