On Thu, Dec 18, 2008 at 7:55 AM, Jorge Vargas <[email protected]> wrote:
>
> Hi, I'm writing unit tests and I was wondering if there is a way to
> ask routes for all possible urls it can handle. if this is not, there
> how hard will it be to implement? Ideally I want to mix this with
> webtest so I can have a generic test that will tell me if all urls I'm
> calling are ok, by ok I mean no 400 or 500 errors, I know this is
> going to be harder for the POSTs but for all the GETs it should be a
> nice addition to the testsuite.
Routes can't do this. You can create some other iterator that "know"
about all valid URL.
Part of the problem is that the internal route format isn't
documented. The bigger problem is that if a route path contains a
variable, a string of any length could be substituted, so the number
of potential URLs is at least 36**N, where N is the maximum URL length
whatever that is. And if you have a /{controller}/{action} route (as
the default Pylons configuration does), then any two-component URL is
valid.
--
Mike Orr <[email protected]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---