# SPDX-License-Identifier: LGPL-2.1+
-from typing import Any, Dict, List, Set
+from typing import Any, List, Mapping, Set
from tests.test_config_parser import MkosiConfig
class DictDiffer:
- def __init__(self, expected_dict: Dict[str, Any], current_dict: Dict[str, Any]) -> None:
+ def __init__(self, expected_dict: Mapping[str, Any], current_dict: Mapping[str, Any]) -> None:
self.current_dict = current_dict
self.expected_dict = expected_dict
self.set_current, self.set_past = set(current_dict.keys()), set(expected_dict.keys())
return ["Invalid datatype"]
if op == "==":
- def compare_job_args(job: str, l_a: Dict[str, Any], r_a: Dict[str, Any]) -> None:
+ def compare_job_args(job: str, l_a: Mapping[str, Any], r_a: Mapping[str, Any]) -> None:
ddiff = DictDiffer(l_a, r_a)
ret.append(f'Comparing parsed configuration {job} against expected configuration:')
ret.append("unexpected:")