Skip to content

Commit

Permalink
add options test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtedn21 committed Nov 10, 2023
1 parent 583b1e4 commit a4ad621
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_http_message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,19 @@ async def test_existing_url(http_get_request, http_headers, content_type):

assert response == http_headers


@pytest.mark.asyncio
async def test_options_method(http_get_request, http_headers):
http_get_request = (
http_get_request
.replace(b'GET', b'OPTIONS')
.replace(b'/users/', b'/test/')
)
http_headers = (
http_headers[:-1] +
b'Allow: OPTIONS, GET, POST\n\n'
)
handler = HttpMessageHandler(http_get_request)
response = await handler.handle_request()

assert response == http_headers

0 comments on commit a4ad621

Please sign in to comment.