def test_should_register_with_callable(self): route = Route('/path', lambda: 'view_func', only_if=lambda x: x) assert route.should_register(True) is True assert route.should_register(False) is False
def test_should_register_defaults_to_true(self): route = Route('/path', lambda: 'view_func') assert route.should_register(None) is True
def test_should_register_with_boolean(self): route = Route('/path', lambda: 'view_func', only_if=True) assert route.should_register(None) is True