@@ -900,12 +900,10 @@ async def test_user_agent_synthetic_bot_detection(self):
900
900
# Clear headers first
901
901
self .scope ["headers" ] = []
902
902
903
- def update_expected_synthetic_bot (expected ):
903
+ def update_expected_synthetic_bot (expected , ua = user_agent ):
904
904
expected [3 ]["attributes" ].update (
905
905
{
906
- SpanAttributes .HTTP_USER_AGENT : user_agent .decode (
907
- "utf8"
908
- ),
906
+ SpanAttributes .HTTP_USER_AGENT : ua .decode ("utf8" ),
909
907
USER_AGENT_SYNTHETIC_TYPE : "bot" ,
910
908
}
911
909
)
@@ -933,12 +931,10 @@ async def test_user_agent_synthetic_test_detection(self):
933
931
# Clear headers first
934
932
self .scope ["headers" ] = []
935
933
936
- def update_expected_synthetic_test (expected ):
934
+ def update_expected_synthetic_test (expected , ua = user_agent ):
937
935
expected [3 ]["attributes" ].update (
938
936
{
939
- SpanAttributes .HTTP_USER_AGENT : user_agent .decode (
940
- "utf8"
941
- ),
937
+ SpanAttributes .HTTP_USER_AGENT : ua .decode ("utf8" ),
942
938
USER_AGENT_SYNTHETIC_TYPE : "test" ,
943
939
}
944
940
)
@@ -967,13 +963,11 @@ async def test_user_agent_non_synthetic(self):
967
963
# Clear headers first
968
964
self .scope ["headers" ] = []
969
965
970
- def update_expected_non_synthetic (expected ):
966
+ def update_expected_non_synthetic (expected , ua = user_agent ):
971
967
# Should only have the user agent, not synthetic type
972
968
expected [3 ]["attributes" ].update (
973
969
{
974
- SpanAttributes .HTTP_USER_AGENT : user_agent .decode (
975
- "utf8"
976
- ),
970
+ SpanAttributes .HTTP_USER_AGENT : ua .decode ("utf8" ),
977
971
}
978
972
)
979
973
return expected
0 commit comments