diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-01-20 05:33:45 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-01-20 05:33:45 +0000 |
| commit | 74a8f69ebc691c0850ab72d8bca421e7b4de52a5 (patch) | |
| tree | 2aa0c9f3d7f222b4f815929d0b69e124053eb857 /repoze/bfg/tests/test_urldispatch.py | |
| parent | 2d5424869375bb9d3c4b24489aa164d9b8095e29 (diff) | |
| download | pyramid-74a8f69ebc691c0850ab72d8bca421e7b4de52a5.tar.gz pyramid-74a8f69ebc691c0850ab72d8bca421e7b4de52a5.tar.bz2 pyramid-74a8f69ebc691c0850ab72d8bca421e7b4de52a5.zip | |
Add (non-failing) tests for ordering issue reported indirectly via http://labs.creativecommons.org/2010/01/13/cc-engine-and-web-non-frameworks/ .. can't seem to repeat.
Diffstat (limited to 'repoze/bfg/tests/test_urldispatch.py')
| -rw-r--r-- | repoze/bfg/tests/test_urldispatch.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_urldispatch.py b/repoze/bfg/tests/test_urldispatch.py index 861a4fd05..c1fa66aa7 100644 --- a/repoze/bfg/tests/test_urldispatch.py +++ b/repoze/bfg/tests/test_urldispatch.py @@ -108,6 +108,27 @@ class RoutesMapperTests(unittest.TestCase): self.assertEqual(result['match']['action'], 'action1') self.assertEqual(result['match']['article'], 'article1') + def test_cc_bug(self): + # "unordered" as reported in IRC by author of + # http://labs.creativecommons.org/2010/01/13/cc-engine-and-web-non-frameworks/ + mapper = self._makeOne() + mapper.connect('licenses/:license_code/:license_version/rdf', 'rdf') + mapper.connect('licenses/:license_code/:license_version/:jurisdiction', + 'juri') + + request = self._getRequest(PATH_INFO='/licenses/1/v2/rdf') + result = mapper(request) + self.assertEqual(result['route'], mapper.routes['rdf']) + self.assertEqual(result['match']['license_code'], '1') + self.assertEqual(result['match']['license_version'], 'v2') + + request = self._getRequest(PATH_INFO='/licenses/1/v2/usa') + result = mapper(request) + self.assertEqual(result['route'], mapper.routes['juri']) + self.assertEqual(result['match']['license_code'], '1') + self.assertEqual(result['match']['license_version'], 'v2') + self.assertEqual(result['match']['jurisdiction'], 'usa') + def test_root_route_matches(self): mapper = self._makeOne() mapper.connect('', 'root') |
