bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.33k stars 1.46k forks source link

Fix router tests by using explicit Route object #1371

Closed iamgodot closed 2 years ago

iamgodot commented 2 years ago

I found the second rule param in self.add() a bit confusing, so this is for better understanding of the code.

defnull commented 2 years ago

The router does not care what you bind to a route, the target of a route can be anything. So, to test the router, you do not need a Route object, just some unique target to identify which route matched. I agree that this is not obvious from the test code, but creating a Route instance is unnecessary here.