mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 23:00:17 +00:00
removed redundant import in routes.py
This commit is contained in:
+3
-2
@@ -1,5 +1,5 @@
|
||||
import re
|
||||
from parse import parse, search
|
||||
from parse import parse
|
||||
|
||||
|
||||
def memoize(f):
|
||||
@@ -60,7 +60,8 @@ class Route:
|
||||
return url
|
||||
|
||||
def _weight(self):
|
||||
params_count = -len(set(self._param_pattern.findall(self.route)))
|
||||
params = set(self._param_pattern.findall(self.route))
|
||||
params_count = -len(params) or 0
|
||||
return params_count != 0, params_count
|
||||
|
||||
@property
|
||||
|
||||
@@ -97,7 +97,7 @@ def test_does_match_with_route(route, match, expected):
|
||||
pytest.param(
|
||||
"/{greetings}_{name}", (True, -2), id="with 2 param and underscore"
|
||||
),
|
||||
pytest.param("/hello", (False, -0), id="with 2 param and underscore"),
|
||||
pytest.param("/hello", (False, 0), id="with 2 param and underscore"),
|
||||
],
|
||||
)
|
||||
def test_weight(path_param, expected_weight):
|
||||
|
||||
Reference in New Issue
Block a user