def test_state_setdefault(): s = SqliteState(":memory:") s.set("key", "value") assert s.get("key") == "value" s.setdefault("key", "newvalue") assert s.get("key") == "value"
def test_state_basic(): s = SqliteState(":memory:") assert s.get("key") == None s.set("key", "value") assert s.get("key") == "value" s.set("int", 101) assert s.get("int") == 101 s.set("bool", False) assert s.get("bool") == False