File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -301,4 +301,4 @@ def test_calling_shutdown_without_startup_errors(self):
301
301
with pytest .raises (RuntimeError ):
302
302
asyncio .get_event_loop ().run_until_complete (
303
303
middleware .notify_shutdown ()
304
- )
304
+ )
Original file line number Diff line number Diff line change 3
3
import threading
4
4
import unittest
5
5
from io import StringIO , BytesIO
6
+ from unittest .mock import MagicMock
6
7
7
8
import pytest
8
9
14
15
WsgiResponse ,
15
16
WsgiMiddleware
16
17
)
17
-
18
+ from azure . functions . _http_asgi import AsgiRequest
18
19
19
20
class WsgiException (Exception ):
20
21
def __init__ (self , message = '' ):
@@ -211,6 +212,18 @@ def test_middleware_wrapper(self):
211
212
self .assertEqual (func_response .status_code , 200 )
212
213
self .assertEqual (func_response .get_body (), b'sample string' )
213
214
215
+ def test_path_encoding_utf8 (self ):
216
+ url = 'http://example.com/Pippi%20L%C3%A5ngstrump'
217
+ request = AsgiRequest (self ._generate_func_request (url = url ))
218
+
219
+ self .assertEqual (request .path_info , '/Pippi Långstrump' )
220
+
221
+ def test_path_encoding_latin1 (self ):
222
+ url = 'http://example.com/Pippi%20L%C3%A5ngstrump'
223
+ request = WsgiRequest (self ._generate_func_request (url = url ))
224
+
225
+ self .assertEqual (request .path_info , '/Pippi LÃ¥ngstrump' )
226
+
214
227
def _generate_func_request (
215
228
self ,
216
229
method = "POST" ,
You can’t perform that action at this time.
0 commit comments