microdot 2.0.4__tar.gz → 2.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {microdot-2.0.4/src/microdot.egg-info → microdot-2.0.5}/PKG-INFO +1 -1
- {microdot-2.0.4 → microdot-2.0.5}/pyproject.toml +1 -1
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/microdot.py +2 -2
- {microdot-2.0.4 → microdot-2.0.5/src/microdot.egg-info}/PKG-INFO +1 -1
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_url_pattern.py +6 -0
- {microdot-2.0.4 → microdot-2.0.5}/LICENSE +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/MANIFEST.in +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/README.md +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/Makefile +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/_static/css/custom.css +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/api.rst +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/conf.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/extensions.rst +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/freezing.rst +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/index.rst +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/intro.rst +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/make.bat +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/docs/migrating.rst +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/setup.cfg +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/__init__.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/asgi.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/cors.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/jinja.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/session.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/sse.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/test_client.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/utemplate.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/websocket.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot/wsgi.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot.egg-info/SOURCES.txt +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot.egg-info/dependency_links.txt +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot.egg-info/not-zip-safe +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot.egg-info/requires.txt +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/src/microdot.egg-info/top_level.txt +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/__init__.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.bin +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.css +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.gif +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.gz +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.html +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.jpg +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.js +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.json +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.png +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/files/test.txt +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/mock_socket.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/templates/hello.jinja.txt +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/templates/hello.utemplate.txt +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/templates/hello_utemplate_txt.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_asgi.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_cors.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_end2end.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_jinja.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_microdot.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_multidict.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_request.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_response.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_session.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_sse.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_urlencode.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_utemplate.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_websocket.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tests/test_wsgi.py +0 -0
- {microdot-2.0.4 → microdot-2.0.5}/tox.ini +0 -0
|
@@ -862,8 +862,6 @@ class URLPattern():
|
|
|
862
862
|
if arg is None:
|
|
863
863
|
return
|
|
864
864
|
if 'name' in segment:
|
|
865
|
-
if not arg:
|
|
866
|
-
return
|
|
867
865
|
args[segment['name']] = arg
|
|
868
866
|
if path is not None:
|
|
869
867
|
return
|
|
@@ -879,6 +877,8 @@ class URLPattern():
|
|
|
879
877
|
|
|
880
878
|
def _string_segment(self, value):
|
|
881
879
|
s = value.split('/', 1)
|
|
880
|
+
if len(s[0]) == 0:
|
|
881
|
+
return None, None
|
|
882
882
|
return s[0], s[1] if len(s) > 1 else None
|
|
883
883
|
|
|
884
884
|
def _int_segment(self, value):
|
|
@@ -26,10 +26,14 @@ class TestURLPattern(unittest.TestCase):
|
|
|
26
26
|
p = URLPattern('/<arg>')
|
|
27
27
|
self.assertEqual(p.match('/foo'), {'arg': 'foo'})
|
|
28
28
|
self.assertIsNone(p.match('/'))
|
|
29
|
+
self.assertIsNone(p.match('//'))
|
|
29
30
|
self.assertIsNone(p.match(''))
|
|
30
31
|
self.assertIsNone(p.match('foo/'))
|
|
31
32
|
self.assertIsNone(p.match('/foo/'))
|
|
33
|
+
self.assertIsNone(p.match('//foo/'))
|
|
34
|
+
self.assertIsNone(p.match('/foo//'))
|
|
32
35
|
self.assertIsNone(p.match('/foo/bar'))
|
|
36
|
+
self.assertIsNone(p.match('/foo//bar'))
|
|
33
37
|
|
|
34
38
|
p = URLPattern('/<arg>/')
|
|
35
39
|
self.assertEqual(p.match('/foo/'), {'arg': 'foo'})
|
|
@@ -64,6 +68,8 @@ class TestURLPattern(unittest.TestCase):
|
|
|
64
68
|
def test_int_argument(self):
|
|
65
69
|
p = URLPattern('/users/<int:id>')
|
|
66
70
|
self.assertEqual(p.match('/users/123'), {'id': 123})
|
|
71
|
+
self.assertEqual(p.match('/users/-123'), {'id': -123})
|
|
72
|
+
self.assertEqual(p.match('/users/0'), {'id': 0})
|
|
67
73
|
self.assertIsNone(p.match('/users/'))
|
|
68
74
|
self.assertIsNone(p.match('/users/abc'))
|
|
69
75
|
self.assertIsNone(p.match('/users/123abc'))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|