99 SwitchableAuthenticatedOTLPExporter ,
1010 SwitchableOTLPMetricExporter ,
1111 SwitchableOTLPSpanExporter ,
12- set_switch ,
12+ enable_agentops_service ,
1313)
1414
1515
@@ -19,12 +19,12 @@ def test_switchable_authenticated_exporter():
1919 with patch .object (
2020 switchable_authenticated_exporter .__class__ .__bases__ [0 ], "export" , return_value = SpanExportResult .SUCCESS
2121 ) as mock_export :
22- set_switch ( True )
22+ enable_agentops_service ( )
2323 result = switchable_authenticated_exporter .export ([])
2424 assert result == SpanExportResult .SUCCESS
2525 mock_export .assert_called_once ()
2626
27- set_switch (False )
27+ enable_agentops_service (False )
2828 result = switchable_authenticated_exporter .export ([])
2929 assert result == SpanExportResult .SUCCESS
3030 assert mock_export .call_count == 1
@@ -36,12 +36,12 @@ def test_switchable_otlp_metric_exporter():
3636 with patch .object (
3737 switchable_otlp_metric_exporter .__class__ .__bases__ [0 ], "export" , return_value = MetricExportResult .SUCCESS
3838 ) as mock_export :
39- set_switch ( True )
39+ enable_agentops_service ( )
4040 result = switchable_otlp_metric_exporter .export (metrics_data = MagicMock ())
4141 assert result == MetricExportResult .SUCCESS
4242 mock_export .assert_called_once ()
4343
44- set_switch (False )
44+ enable_agentops_service (False )
4545 result = switchable_otlp_metric_exporter .export (metrics_data = MagicMock ())
4646 assert result == MetricExportResult .SUCCESS
4747 assert mock_export .call_count == 1
@@ -53,12 +53,12 @@ def test_switchable_otlp_span_exporter():
5353 with patch .object (
5454 switchable_otlp_span_exporter .__class__ .__bases__ [0 ], "export" , return_value = SpanExportResult .SUCCESS
5555 ) as mock_export :
56- set_switch ( True )
56+ enable_agentops_service ( )
5757 result = switchable_otlp_span_exporter .export ([])
5858 assert result == SpanExportResult .SUCCESS
5959 mock_export .assert_called_once ()
6060
61- set_switch (False )
61+ enable_agentops_service (False )
6262 result = switchable_otlp_span_exporter .export ([])
6363 assert result == SpanExportResult .SUCCESS
6464 assert mock_export .call_count == 1
0 commit comments