diff options
author | Mike Burrows <mjb@asplake.co.uk> | 2010-02-14 12:37:52 +0000 |
---|---|---|
committer | Mike Burrows <mjb@asplake.co.uk> | 2010-02-14 12:37:52 +0000 |
commit | 4336dc64fa8a2c7012facce8d7f71d5ec84f29e6 (patch) | |
tree | 7526c64a8ef57980791c3725f5a04928fd23b0cd /tests | |
parent | 66a43fd54757119e3021801bbc636de980f3cc53 (diff) | |
download | routes-4336dc64fa8a2c7012facce8d7f71d5ec84f29e6.tar.gz |
Fix inline requirements in {.format:reqs}
--HG--
branch : trunk
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_functional/test_generation.py | 4 | ||||
-rw-r--r-- | tests/test_functional/test_recognition.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_functional/test_generation.py b/tests/test_functional/test_generation.py index 9bff54a..6c40df1 100644 --- a/tests/test_functional/test_generation.py +++ b/tests/test_functional/test_generation.py @@ -631,9 +631,13 @@ class TestGeneration(unittest.TestCase): m = Mapper(explicit=True) m.minimization=minimization m.connect('/songs/{title}{.format}') + m.connect('/stories/{slug}{.format:pdf}') eq_('/songs/my-way', m.generate(title='my-way')) eq_('/songs/my-way.mp3', m.generate(title='my-way', format='mp3')) + eq_('/stories/frist-post', m.generate(slug='frist-post')) + eq_('/stories/frist-post.pdf', m.generate(slug='frist-post', format='pdf')) + eq_(None, m.generate(slug='frist-post', format='doc')) if __name__ == '__main__': unittest.main() diff --git a/tests/test_functional/test_recognition.py b/tests/test_functional/test_recognition.py index 9dcc861..bffe5b3 100644 --- a/tests/test_functional/test_recognition.py +++ b/tests/test_functional/test_recognition.py @@ -934,9 +934,13 @@ class TestRecognition(unittest.TestCase): m = Mapper(explicit=True) m.minimization=minimization m.connect('/songs/{title}{.format}') + m.connect('/stories/{slug:[^./]+?}{.format:pdf}') eq_({'title': 'my-way', 'format': None}, m.match('/songs/my-way')) eq_({'title': 'my-way', 'format': 'mp3'}, m.match('/songs/my-way.mp3')) + eq_({'slug': 'frist-post', 'format': None}, m.match('/stories/frist-post')) + eq_({'slug': 'frist-post', 'format': 'pdf'}, m.match('/stories/frist-post.pdf')) + eq_(None, m.match('/stories/frist-post.doc')) if __name__ == '__main__': |