File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
instrumentation/opentelemetry-instrumentation-aiohttp-server/tests Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 15
15
import pytest
16
16
import pytest_asyncio
17
17
import aiohttp
18
- from http import HTTPMethod , HTTPStatus
18
+ from http import HTTPStatus
19
+ from .utils import HTTPMethod
19
20
from pkg_resources import iter_entry_points
20
21
from unittest import mock
21
22
Original file line number Diff line number Diff line change
1
+ # This was adapted from Python 3.11 http module.
2
+ from enum import Enum
3
+
4
+
5
+ class HTTPMethod (Enum ):
6
+ """HTTP methods and descriptions
7
+
8
+ Methods from the following RFCs are all observed:
9
+
10
+ * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616
11
+ * RFC 5789: PATCH Method for HTTP
12
+ """
13
+
14
+ def __repr__ (self ):
15
+ return self .value [0 ]
16
+
17
+ CONNECT = 'CONNECT' , 'Establish a connection to the server.'
18
+ DELETE = 'DELETE' , 'Remove the target.'
19
+ GET = 'GET' , 'Retrieve the target.'
20
+ HEAD = 'HEAD' , 'Same as GET, but only retrieve the status line and header section.'
21
+ OPTIONS = 'OPTIONS' , 'Describe the communication options for the target.'
22
+ PATCH = 'PATCH' , 'Apply partial modifications to a target.'
23
+ POST = 'POST' , 'Perform target-specific processing with the request payload.'
24
+ PUT = 'PUT' , 'Replace the target with the request payload.'
25
+ TRACE = 'TRACE' , 'Perform a message loop-back test along the path to the target.'
You can’t perform that action at this time.
0 commit comments