示例#1
0
 def test_customRouterAttribute(self):
     """
     A custom ``routerAttribute``.
     """
     resource = routedResource(_SubroutedThing, 'otherRouter')()
     self.assertThat(
         renderRoute(resource, [b'other']).written,
         Equals([b'other router']))
     self.assertThat(
         renderRoute(resource, [b'bar', b'foo']).responseCode,
         Equals(http.NOT_FOUND))
示例#2
0
 def test_defaultRouterAttribute(self):
     """
     ``routerAttribute`` defaults to ``'router'``.
     """
     resource = routedResource(_SubroutedThing)()
     self.assertThat(
         renderRoute(resource, [b'bar', b'foo']).written,
         Equals([b'hello world']))
     self.assertThat(
         renderRoute(resource, [b'other']).responseCode,
         Equals(http.NOT_FOUND))