aboutsummaryrefslogtreecommitdiffstats
path: root/backend/route.py
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-12-15 08:41:49 +0200
committerGravatar GitHub <[email protected]>2020-12-15 08:41:49 +0200
commit13b031581763f080c2415ac2bd76e2ad40aeb8dc (patch)
tree1cbfdd2219c56c4cf8f5a590ad2e72cf3b63bc75 /backend/route.py
parentUpdate route levels parsing to work in all platforms (diff)
parentFix 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.py10
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")