def test_basics(): rt = RouteTree() rt.set(['a', 'b'], 100, True) assert rt.get(['a', 'b'], True) == (100, {})
def test_non_strict(): rt = RouteTree() rt.set(['a', 'b'], 100, True) assert rt.get(['a', 'b', 'c'], False) == (100, {})
def test_non_existance(): rt = RouteTree() rt.set(['a'], 200, True) assert rt.get(['b'], True) == (None, {})
def test_wildcard(): rt = RouteTree() rt.set(['c', ':d'], 200, True) assert rt.get(['c', 'x'], True) == (200, {'d': 'x'})