コード例 #1
0
 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
コード例 #2
0
 def test_should_register_defaults_to_true(self):
     route = Route('/path', lambda: 'view_func')
     assert route.should_register(None) is True
コード例 #3
0
 def test_should_register_with_boolean(self):
     route = Route('/path', lambda: 'view_func', only_if=True)
     assert route.should_register(None) is True