diff options
author | 2020-12-15 08:41:49 +0200 | |
---|---|---|
committer | 2020-12-15 08:41:49 +0200 | |
commit | 13b031581763f080c2415ac2bd76e2ad40aeb8dc (patch) | |
tree | 1cbfdd2219c56c4cf8f5a590ad2e72cf3b63bc75 /backend/route.py | |
parent | Update route levels parsing to work in all platforms (diff) | |
parent | Fix f-string referencing the wrong name (diff) |
Merge pull request #29 from python-discord/testing-strategies
Refactor `create_route_map`
Diffstat (limited to 'backend/route.py')
-rw-r--r-- | backend/route.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/backend/route.py b/backend/route.py index eb69ebc..d778bf0 100644 --- a/backend/route.py +++ b/backend/route.py @@ -5,13 +5,13 @@ from starlette.endpoints import HTTPEndpoint class Route(HTTPEndpoint): - name: str = None - path: str = None + name: str + path: str @classmethod - def check_parameters(cls) -> "Route": - if cls.name is None: + def check_parameters(cls) -> None: + if not hasattr(cls, "name"): raise ValueError(f"Route {cls.__name__} has not defined a name") - if cls.path is None: + if not hasattr(cls, "path"): raise ValueError(f"Route {cls.__name__} has not defined a path") |