clan-cli/tests: improve test helpers for VMs

This commit is contained in:
DavHau
2024-08-03 15:22:58 +07:00
parent cc9c828598
commit 8086f70b79
3 changed files with 76 additions and 127 deletions

View File

@@ -0,0 +1,11 @@
from collections import defaultdict
from collections.abc import Callable
from typing import Any
def def_value() -> defaultdict:
return defaultdict(def_value)
# allows defining nested dictionary in a single line
nested_dict: Callable[[], dict[str, Any]] = lambda: defaultdict(def_value)