removed redundant import in routes.py

This commit is contained in:
Luna
2018-10-17 21:17:14 +01:00
parent 558ced1afb
commit 3be88c8cbf
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -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
+1 -1
View File
@@ -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):