def test_hashtable_collision(): hashtable = Hashtable() hashtable.add("key", "value1") hashtable.add("yek", "value2") assert hashtable._hash("key") == hashtable._hash("yek") assert hashtable.get("key") == "value1" assert hashtable.get("yek") == "value2"
def test_hashtable_add_and_get(): hashtable = Hashtable() hashtable.add("key", "value") assert hashtable.get("key") == "value"
def test_hashtable_get_none_key(): hashtable = Hashtable() assert hashtable.get("key") == None