summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Tolerate older usage with mandatory routename and optional pathDavanum Srinivas2016-03-291-0/+6
| | | | | | | | | | | | | | | | | With the following review: https://github.com/bbangert/routes/commit/0a417004be7e2d950bdcd629ccf24cf9f56ef817 Routes 2.3 has changed the function signature to mandate path in addition to routename for the connect method. In this patch, we try to get back to path being optional by checking the length of the args list. No other change in logic. This hopefully fixes the problem reported here: https://github.com/bbangert/routes/issues/64 Add an entry in Changelog as well.
* Fix subdomain equivalence check. Use regex instead of startswithNikita Uvarov2016-03-241-0/+8
| | | | | Problem occurred when new subdomain was left substring of current one. In this case subdomain was not replaced.
* Add tests for protocol-relative URLs generation. Close #29Sviatoslav Sydorenko2016-02-231-0/+2
|
* Ajusts empty value testsSviatoslav Sydorenko2016-02-011-2/+2
|
* Add support for ``requirements`` to mapper.resourceSean Dague2016-01-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | This adds support for ``requirements`` option to mapper.resource, which makes it possible to restrict matching in urls (most often useful for capturing variables with path_prefix). In OpenStack Nova we've used the prefix_path on Mapper.resource to specify additional variables we want to capture (specifically {project_id}). Project_id is a uuid. When trying to restrict project_id to only valid uuid format a couple of issues were exposed. - #1 '/{project_id:[a-f0-9]{32}}/...' builds an incorrect regex because of the nested {} - #2 the preferred method that works on connect() to pass requirements doesn't work here (requirements are reset to only an id match) That leaves us with having to build a custom project_id match with 32 [a-f0-9] strings appended for every resource added to get the support we need without effectively vendoring our own version of Mapper.resource. This small change to allow requirements to pass through would make it possible to get this tighter validation with much smaller regexes.
* Add test for arg override behaviors in submappersmikepk2015-08-181-0/+37
|
* Port routes to Python 3Victor Stinner2015-06-187-28/+28
| | | | | | | | | | | | | | | | | | | The code now works on Python 2 and Python 3 without modifications: 2to3 is no more needed. Changes: * Drop 2to3 from setup.py: the code is now directly compatible with Python 2 and Python 3 * Add dependency to six * Drop support for Python 3.2: remove 3.2 from .travis.yml * Replace "for key, value in dict.iteritems():" with "for key, value in six.iteritems(dict):" * Use six.moves.urllib to get urllib functions * Replace unicode() with six.text_type() * Replace dict.keys() with list(dict.keys()) * Replace "dict.has_key(key)" with "key in dict" * Remove "py3where=build" from notests section of setup.cfg * Add parenthesis to print() * Replace dict.items() with list(dict.items())
* * Printing a mapper now includes the Controller/action parameters from theBen Bangert2015-01-171-4/+4
| | | | route. Fixes #11.
* * Fix regression that didn't allow passing in params 'host', 'protocol', orBen Bangert2015-01-171-2/+12
| | | | | 'anchor'. They can now be passed in with a trailing '_' as was possible before commit d1d1742903fa5ca24ef848a6ae895303f2661b2a. Fixes #7.
* * URL generation with/without SCRIPT_NAME was resulting in the URL cacheBen Bangert2015-01-171-0/+7
| | | | | | failing to return the appropriate cached URL generation. The URL cache should always include the SCRIPT_NAME, even if its empty, in the cache to avoid this, and now does. Fixes #6.
* Whitespace removal.Ben Bangert2015-01-177-368/+368
|
* Merge pull request #14 from blamarvt/overflow-fixBen Bangert2013-11-201-0/+6
|\ | | | | Allow for a large number of URL matches
| * Allow for a large number of URL matchesBrian Lamar2013-11-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | Currently routes/regex raises an OverflowError when compiling a master list of 'valid' URLs if the number of controllers/routes is extremely high. This error can be worked around by assuming all URLs are good until all matches have been tested. This means that on large projects performance will be slightly increased with valid requests and slightly decreased with invalid requests.
* | Add tests for submappers' controllers fixYuriy Taraday2013-11-181-0/+12
| |
* | Rewrite test to work with random hash dictsBen Bangert2013-11-171-103/+105
|/
* Add Python 3 support.Alejandro Sánchez2013-05-033-19/+28
|
* keep pstats out tooBen Bangert2012-03-131-1/+1
| | | | | --HG-- branch : trunk
* handle missing profileBen Bangert2012-03-131-1/+4
| | | | | --HG-- branch : trunk
* Added functionality to allow escaped dots in urlsMichael Basnight2012-02-281-0/+22
| | | | | | | | | * Added to regex to allow excaped dots in urls * Added tests to make sure escaped dots work and dont clobber the existing format strings --HG-- branch : trunk
* * Fix bug with URLGenerator not properly including SCRIPT_NAME when generatingBen Bangert2010-06-052-0/+16
| | | | | | | URL's and the singleton is not present. --HG-- branch : trunk
* * Fix bug with routes not generating URL's with callables in defaults.v1.12.1Ben Bangert2010-03-111-0/+13
| | | | | --HG-- branch : trunk
* * Fix bug with routes not handling sub-domain defaults during generation.Ben Bangert2010-03-051-0/+26
| | | | | --HG-- branch : trunk
* * Fix bug with relative URL's using qualified merging host and URL withoutBen Bangert2010-02-281-0/+11
| | | | | | | including the appropriate slash. Fixes #13. --HG-- branch : trunk
* * Fix bug with mapper.extend and Routes modifying their original args.Ben Bangert2010-02-281-0/+10
| | | | | | | Fixes #24. --HG-- branch : trunk
* * Fix url.current() not returning current args when explicit is True.Ben Bangert2010-02-281-0/+11
| | | | | | | * Return explicit to being default to True. --HG-- branch : trunk
* Ensure singleton usage is still default in middleware so Routes upgrade ↵Ben Bangert2010-02-281-2/+25
| | | | | | | doesn't break url_for users. --HG-- branch : trunk
* Another module up to 100% test coverageBen Bangert2010-02-201-0/+28
| | | | | --HG-- branch : trunk
* mergeBen Bangert2010-02-202-0/+27
|\ | | | | | | | | --HG-- branch : trunk
| * Fix inline requirements in {.format:reqs}Mike Burrows2010-02-142-0/+8
| | | | | | | | | | --HG-- branch : trunk
| * {.format} path componentsMike Burrows2010-02-102-0/+19
| | | | | | | | | | --HG-- branch : trunk
* | More test coverageBen Bangert2010-02-202-1/+12
| | | | | | | | | | --HG-- branch : trunk
* | Increase unit tests and add more explicit use of the mapper for matching.Ben Bangert2010-02-203-0/+87
| | | | | | | | | | --HG-- branch : trunk
* | Backout explicit change.Ben Bangert2010-01-234-3/+6
|/ | | | | --HG-- branch : trunk
* Mapper.explicit now defaults to TrueMike Burrows2010-01-117-82/+80
| | | | | --HG-- branch : trunk
* Mapper.minimization now defaults to FalseMike Burrows2010-01-096-3/+111
| | | | | --HG-- branch : trunk
* Fix additional testMike Burrows2009-12-291-4/+3
| | | | | --HG-- branch : trunk
* Add test for collection-level conditions and requirementsMike Burrows2009-12-291-0/+10
| | | | | --HG-- branch : trunk
* Code layout changesMike Burrows2009-12-291-28/+13
| | | | | --HG-- branch : trunk
* some tests need Mapper(explicit=True) to maintain test isolationMike Burrows2009-12-271-2/+2
| | | | | --HG-- branch : trunk
* add unit test for Mapper.__str__()Mike Burrows2009-12-261-0/+18
| | | | | --HG-- branch : trunk
* initial commit: nestable submappers, collection(), prettyprinterMike Burrows2009-12-261-0/+153
| | | | | --HG-- branch : trunk
* Fix bug with capturing large groupsBen Bangert2009-11-201-0/+2
| | | | | --HG-- branch : trunk
* * Adding regular expression builder for entire regexp for faster rejectionBen Bangert2009-11-101-2/+2
| | | | | | | in a single regexp match should none of the routes match. --HG-- branch : trunk
* * Mapper controller_scan argument now handles None, and lists of controllerBen Bangert2009-08-042-1/+4
| | | | | | | | | | names in addition to a callable. * Route object now takes a name parameter, which is the name it responds to. This name is automatically added when called by using Mapper's connect class method. --HG-- branch : trunk
* Centralize tests for resources since they require both generation and ↵Mike Naberezny2009-06-113-390/+402
| | | | | | | recognition. --HG-- branch : trunk
* Use consistent testing style with nose.tools.Mike Naberezny2009-06-114-284/+295
| | | | | --HG-- branch : trunk
* Use consistent testing style with nose.tools.Mike Naberezny2009-06-111-279/+279
| | | | | --HG-- branch : trunk
* fixed an issue when passing extra args as a list of unicode to generate()Alexandre Conrad2009-05-181-0/+17
| | | | | --HG-- branch : trunk
* Add a test for noargs.Chris McDonough2009-05-101-1/+12
| | | | | --HG-- branch : trunk
* Only profile the actual matching.Chris McDonough2009-01-241-10/+15
| | | | | | | | (transplanted from 25b1574b12770fa9998a79093d34f73c298a2421) --HG-- branch : trunk extra : transplant_source : %25%B1WK%12w%0F%A9%99%8Ay%09%3D4%F7%3C%29%8A%24%21