@@ -42,22 +42,19 @@ def hello_endpoint(helloid):
42
42
self .client = Client (self .app , BaseResponse )
43
43
44
44
def test_simple (self ):
45
- expected_attrs = BoundedDict .from_map (
46
- MAX_NUM_ATTRIBUTES ,
47
- {
48
- "component" : "http" ,
49
- "http.method" : "GET" ,
50
- "http.server_name" : "localhost" ,
51
- "http.scheme" : "http" ,
52
- "host.port" : 80 ,
53
- "http.host" : "localhost" ,
54
- "http.target" : "/hello/123" ,
55
- "http.flavor" : "1.1" ,
56
- "http.route" : "/hello/<int:helloid>" ,
57
- "http.status_text" : "OK" ,
58
- "http.status_code" : 200 ,
59
- },
60
- )
45
+ expected_attrs = {
46
+ "component" : "http" ,
47
+ "http.method" : "GET" ,
48
+ "http.server_name" : "localhost" ,
49
+ "http.scheme" : "http" ,
50
+ "host.port" : 80 ,
51
+ "http.host" : "localhost" ,
52
+ "http.target" : "/hello/123" ,
53
+ "http.flavor" : "1.1" ,
54
+ "http.route" : "/hello/<int:helloid>" ,
55
+ "http.status_text" : "OK" ,
56
+ "http.status_code" : 200 ,
57
+ }
61
58
resp = self .client .get ("/hello/123" )
62
59
self .assertEqual (200 , resp .status_code )
63
60
self .assertEqual ([b"Hello: 123" ], list (resp .response ))
@@ -68,21 +65,18 @@ def test_simple(self):
68
65
self .assertEqual (span_list [0 ].attributes , expected_attrs )
69
66
70
67
def test_404 (self ):
71
- expected_attrs = BoundedDict .from_map (
72
- MAX_NUM_ATTRIBUTES ,
73
- {
74
- "component" : "http" ,
75
- "http.method" : "POST" ,
76
- "http.server_name" : "localhost" ,
77
- "http.scheme" : "http" ,
78
- "host.port" : 80 ,
79
- "http.host" : "localhost" ,
80
- "http.target" : "/bye" ,
81
- "http.flavor" : "1.1" ,
82
- "http.status_text" : "NOT FOUND" ,
83
- "http.status_code" : 404 ,
84
- },
85
- )
68
+ expected_attrs = {
69
+ "component" : "http" ,
70
+ "http.method" : "POST" ,
71
+ "http.server_name" : "localhost" ,
72
+ "http.scheme" : "http" ,
73
+ "host.port" : 80 ,
74
+ "http.host" : "localhost" ,
75
+ "http.target" : "/bye" ,
76
+ "http.flavor" : "1.1" ,
77
+ "http.status_text" : "NOT FOUND" ,
78
+ "http.status_code" : 404 ,
79
+ }
86
80
resp = self .client .post ("/bye" )
87
81
self .assertEqual (404 , resp .status_code )
88
82
resp .close ()
@@ -93,22 +87,19 @@ def test_404(self):
93
87
self .assertEqual (span_list [0 ].attributes , expected_attrs )
94
88
95
89
def test_internal_error (self ):
96
- expected_attrs = BoundedDict .from_map (
97
- MAX_NUM_ATTRIBUTES ,
98
- {
99
- "component" : "http" ,
100
- "http.method" : "GET" ,
101
- "http.server_name" : "localhost" ,
102
- "http.scheme" : "http" ,
103
- "host.port" : 80 ,
104
- "http.host" : "localhost" ,
105
- "http.target" : "/hello/500" ,
106
- "http.flavor" : "1.1" ,
107
- "http.route" : "/hello/<int:helloid>" ,
108
- "http.status_text" : "INTERNAL SERVER ERROR" ,
109
- "http.status_code" : 500 ,
110
- },
111
- )
90
+ expected_attrs = {
91
+ "component" : "http" ,
92
+ "http.method" : "GET" ,
93
+ "http.server_name" : "localhost" ,
94
+ "http.scheme" : "http" ,
95
+ "host.port" : 80 ,
96
+ "http.host" : "localhost" ,
97
+ "http.target" : "/hello/500" ,
98
+ "http.flavor" : "1.1" ,
99
+ "http.route" : "/hello/<int:helloid>" ,
100
+ "http.status_text" : "INTERNAL SERVER ERROR" ,
101
+ "http.status_code" : 500 ,
102
+ }
112
103
resp = self .client .get ("/hello/500" )
113
104
self .assertEqual (500 , resp .status_code )
114
105
resp .close ()
0 commit comments