Skip to content

Commit 06cf6c2

Browse files
committed
Add automatic test cases
1 parent d08b82b commit 06cf6c2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ext/opentelemetry-ext-flask/tests/test_automatic.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ def test_uninstrument(self):
6969
self.assertEqual(span_list[0].attributes, expected_attrs)
7070

7171
FlaskInstrumentor().uninstrument()
72+
self.app = flask.Flask(__name__)
73+
74+
def hello_endpoint(helloid):
75+
if helloid == 500:
76+
raise ValueError(":-(")
77+
return "Hello: " + str(helloid)
78+
79+
self.app.route("/hello/<int:helloid>")(hello_endpoint)
80+
81+
self.client = Client(self.app, BaseResponse)
7282

7383
expected_attrs = expected_attributes(
7484
{"http.target": "/hello/123", "http.route": "/hello/<int:helloid>"}

0 commit comments

Comments
 (0)