Merging upstream version 1.2.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
ae7b7df396
commit
afeccccd6a
154 changed files with 7346 additions and 5000 deletions
|
@ -11,7 +11,7 @@ from typing import Any
|
|||
|
||||
import pytest
|
||||
|
||||
from anta.tools import convert_categories, custom_division, get_dict_superset, get_failed_logs, get_item, get_value
|
||||
from anta.tools import convert_categories, custom_division, format_data, get_dict_superset, get_failed_logs, get_item, get_value
|
||||
|
||||
TEST_GET_FAILED_LOGS_DATA = [
|
||||
{"id": 1, "name": "Alice", "age": 30, "email": "alice@example.com"},
|
||||
|
@ -513,3 +513,17 @@ def test_convert_categories(test_input: list[str], expected_raise: AbstractConte
|
|||
"""Test convert_categories."""
|
||||
with expected_raise:
|
||||
assert convert_categories(test_input) == expected_result
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("input_data", "expected_output"),
|
||||
[
|
||||
pytest.param({"advertised": True, "received": True, "enabled": True}, "Advertised: True, Received: True, Enabled: True", id="multiple entry, all True"),
|
||||
pytest.param({"advertised": False, "received": False}, "Advertised: False, Received: False", id="multiple entry, all False"),
|
||||
pytest.param({}, "", id="empty dict"),
|
||||
pytest.param({"test": True}, "Test: True", id="single entry"),
|
||||
],
|
||||
)
|
||||
def test_format_data(input_data: dict[str, bool], expected_output: str) -> None:
|
||||
"""Test format_data."""
|
||||
assert format_data(input_data) == expected_output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue