Gentoo Archives: gentoo-commits

From: "Tim Harder (radhermit)" <radhermit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/routes/files: routes-2.0-tests-py3.patch
Date: Thu, 21 Nov 2013 20:54:02
Message-Id: 20131121205358.0A0292004B@flycatcher.gentoo.org
1 radhermit 13/11/21 20:53:57
2
3 Added: routes-2.0-tests-py3.patch
4 Log:
5 Version bump.
6
7 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 4AB3E85B4F064CA3)
8
9 Revision Changes Path
10 1.1 dev-python/routes/files/routes-2.0-tests-py3.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/routes/files/routes-2.0-tests-py3.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/routes/files/routes-2.0-tests-py3.patch?rev=1.1&content-type=text/plain
14
15 Index: routes-2.0-tests-py3.patch
16 ===================================================================
17 Fix tests to work with random hash dicts.
18
19 --- a/tests/test_functional/test_generation.py
20 +++ b/tests/test_functional/test_generation.py
21 @@ -205,13 +205,14 @@ class TestGeneration(unittest.TestCase):
22 requirements={'month':'\d{1,2}','day':'\d{1,2}'})
23 m.connect('viewpost/:id', controller='post', action='view')
24 m.connect(':controller/:action/:id')
25 -
26 - eq_('/blog/view?year=2004&month=blah', m.generate(controller='blog', action='view', year=2004, month='blah'))
27 +
28 + url = m.generate(controller='blog', action='view', year=2004, month='blah')
29 + assert url == '/blog/view?year=2004&month=blah' or url == '/blog/view?month=blah&year=2004'
30 eq_('/archive/2004/11', m.generate(controller='blog', action='view', year=2004, month=11))
31 eq_('/archive/2004/11', m.generate(controller='blog', action='view', year=2004, month='11'))
32 eq_('/archive/2004', m.generate(controller='blog', action='view', year=2004))
33 eq_('/viewpost/3', m.generate(controller='post', action='view', id=3))
34 -
35 +
36 def test_multiroute_with_splits(self):
37 m = Mapper(explicit=False)
38 m.minimization = True
39 @@ -219,13 +220,14 @@ class TestGeneration(unittest.TestCase):
40 requirements={'month':'\d{1,2}','day':'\d{1,2}'})
41 m.connect('viewpost/:(id)', controller='post', action='view')
42 m.connect(':(controller)/:(action)/:(id)')
43 -
44 - eq_('/blog/view?year=2004&month=blah', m.generate(controller='blog', action='view', year=2004, month='blah'))
45 +
46 + url = m.generate(controller='blog', action='view', year=2004, month='blah')
47 + assert url == '/blog/view?year=2004&month=blah' or url == '/blog/view?month=blah&year=2004'
48 eq_('/archive/2004/11', m.generate(controller='blog', action='view', year=2004, month=11))
49 eq_('/archive/2004/11', m.generate(controller='blog', action='view', year=2004, month='11'))
50 eq_('/archive/2004', m.generate(controller='blog', action='view', year=2004))
51 eq_('/viewpost/3', m.generate(controller='post', action='view', id=3))
52 -
53 +
54 def test_big_multiroute(self):
55 m = Mapper(explicit=False)
56 m.minimization = True