コード例 #1
0
    def test_non_existing_sub_route(self):
        sub_route = Route(FAKE_VIEW, 'sub_route_1')
        route = Route(FAKE_VIEW, FAKE_ROUTE_NAME, [sub_route])

        non_existing_route_name = 'non_existing'
        with assert_raises_substring(
            NonExistingRouteError,
            non_existing_route_name,
            ):
            route.get_route_by_name(non_existing_route_name)
コード例 #2
0
    def test_existing_direct_sub_route(self):
        sub_route_name = 'sub_route_1'
        sub_route = Route(FAKE_VIEW, sub_route_name)
        route = Route(FAKE_VIEW, FAKE_ROUTE_NAME, [sub_route])

        retrieved_route = route.get_route_by_name(sub_route_name)
        eq_(sub_route, retrieved_route)
コード例 #3
0
    def test_existing_own_route(self):
        route_name = 'route_1'
        route = Route(FAKE_VIEW, route_name)

        retrieved_route = route.get_route_by_name(route_name)
        eq_(route, retrieved_route)