Andriy Kornatskyy avatar Andriy Kornatskyy committed 199aae8

There is no match in the inner router, continue with the rest in self.mapping.

Comments (0)

Files changed (1)

src/wheezy/routing/tests/test_router.py

         """
         m = [('pattern', 'handler', 'kwargs')]
         self.r.add_route = mock_add_route = self.m.mock()
-        expect(mock_add_route('pattern', 'handler', 'kwargs', None))
+        expect(
+            mock_add_route('pattern', 'handler', 'kwargs', None)
+        )
         self.m.replay()
 
         self.r.add_routes(m)
     def test_mapping_is_tuple_of_four(self):
         """ ``mapping`` is a tuple of four elements.
         """
-        m = [('pattern', 'handler', 'kwargs', 'name')]
+        m = [('pattern', 'handler', 'kw', 'name')]
         self.r.add_route = mock_add_route = self.m.mock()
         expect(
-            mock_add_route('pattern', 'handler', 'kwargs', 'name')
+            mock_add_route('pattern', 'handler', 'kw', 'name')
         )
         self.m.replay()
 
         self.m.verify()
 
     def test_no_match(self):
-        """ there is a match is inner, kwargs and kwargs2 are None.
+        """ there is no match.
         """
         expect(self.mock_inner.match('de')).result((None, None))
         self.m.replay()
         assert handler is None
         assert kwargs is None
 
+    def test_no_match_continue(self):
+        """ there is no match, continue with the rest 
+        	in ``self.mapping``.
+        """
+        expect(self.mock_inner.match('de')).result((None, None))
+        self.m.replay()
+
+        self.r.include('abc/', [])
+        self.r.add_route('abc/de', 'h')
+        handler, kwargs = self.r.match('abc/de')
+
+        self.assertEquals('h', handler)
+
     def test_no_kwargs(self):
-        """ there is a match is inner, kwargs and kwargs2 are None.
+        """ there is a match is inner, kwargs and kwargs2
+            are None.
         """
         expect(self.mock_inner.match('de')).result(('h', None))
         self.m.replay()
         self.assertEquals(kw, kwargs)
 
     def test_kwargs_merge(self):
-        """ there is a match is inner, kwargs and kwargs2 are None.
+        """ there is a match is inner, kwargs and kwargs2
+            are None.
         """
         expect(self.mock_inner.match('de')).result(('h', {'b': 2}))
         self.m.replay()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.