From 5c965e004c834dcfd1ff1590a5e41a375d83bceb Mon Sep 17 00:00:00 2001 From: Florimond Husquinet Date: Sat, 3 Aug 2019 11:03:55 +0200 Subject: [PATCH] subtrie add test replace handler --- emitter/subtrie_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/emitter/subtrie_test.py b/emitter/subtrie_test.py index 97ca774..d699abf 100644 --- a/emitter/subtrie_test.py +++ b/emitter/subtrie_test.py @@ -33,6 +33,14 @@ def test_lookup_with_wildcard(): results = t.lookup(k) assert len(results) == v +def test_replace_handler(): + t = SubTrie() + t.insert("a", lambda: "a1") + t.insert("a", lambda: "a2") + + results = t.lookup("a") + assert len(results) == 1 + assert results[0]() == "a2" def test_delete_parent(): t = SubTrie()