summaryrefslogtreecommitdiff
path: root/dev-python/routes/files/routes-2.0-tests-py3.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/routes/files/routes-2.0-tests-py3.patch')
-rw-r--r--dev-python/routes/files/routes-2.0-tests-py3.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/dev-python/routes/files/routes-2.0-tests-py3.patch b/dev-python/routes/files/routes-2.0-tests-py3.patch
new file mode 100644
index 00000000000..ec21799ba14
--- /dev/null
+++ b/dev-python/routes/files/routes-2.0-tests-py3.patch
@@ -0,0 +1,40 @@
+Fix tests to work with random hash dicts.
+
+--- a/tests/test_functional/test_generation.py
++++ b/tests/test_functional/test_generation.py
+@@ -205,13 +205,14 @@ class TestGeneration(unittest.TestCase):
+ requirements={'month':'\d{1,2}','day':'\d{1,2}'})
+ m.connect('viewpost/:id', controller='post', action='view')
+ m.connect(':controller/:action/:id')
+-
+- eq_('/blog/view?year=2004&month=blah', m.generate(controller='blog', action='view', year=2004, month='blah'))
++
++ url = m.generate(controller='blog', action='view', year=2004, month='blah')
++ assert url == '/blog/view?year=2004&month=blah' or url == '/blog/view?month=blah&year=2004'
+ eq_('/archive/2004/11', m.generate(controller='blog', action='view', year=2004, month=11))
+ eq_('/archive/2004/11', m.generate(controller='blog', action='view', year=2004, month='11'))
+ eq_('/archive/2004', m.generate(controller='blog', action='view', year=2004))
+ eq_('/viewpost/3', m.generate(controller='post', action='view', id=3))
+-
++
+ def test_multiroute_with_splits(self):
+ m = Mapper(explicit=False)
+ m.minimization = True
+@@ -219,13 +220,14 @@ class TestGeneration(unittest.TestCase):
+ requirements={'month':'\d{1,2}','day':'\d{1,2}'})
+ m.connect('viewpost/:(id)', controller='post', action='view')
+ m.connect(':(controller)/:(action)/:(id)')
+-
+- eq_('/blog/view?year=2004&month=blah', m.generate(controller='blog', action='view', year=2004, month='blah'))
++
++ url = m.generate(controller='blog', action='view', year=2004, month='blah')
++ assert url == '/blog/view?year=2004&month=blah' or url == '/blog/view?month=blah&year=2004'
+ eq_('/archive/2004/11', m.generate(controller='blog', action='view', year=2004, month=11))
+ eq_('/archive/2004/11', m.generate(controller='blog', action='view', year=2004, month='11'))
+ eq_('/archive/2004', m.generate(controller='blog', action='view', year=2004))
+ eq_('/viewpost/3', m.generate(controller='post', action='view', id=3))
+-
++
+ def test_big_multiroute(self):
+ m = Mapper(explicit=False)
+ m.minimization = True