notif_report #3

Merged
jonas merged 18 commits from notif_report into main 2025-10-06 12:50:41 +00:00
2 changed files with 13 additions and 7 deletions
Showing only changes of commit 325965bb10 - Show all commits

2
.gitignore vendored
View File

@@ -17,6 +17,8 @@ wheels/
# ignore test_data content but keep the folder # ignore test_data content but keep the folder
test_data/* test_data/*
test/test_output/*
# ignore secrets # ignore secrets
secrets.yaml secrets.yaml

View File

@@ -1,4 +1,5 @@
import json
import pytest import pytest
import asyncio import asyncio
from alpine_bits_python.alpinebits_server import AlpineBitsServer, AlpineBitsClientInfo from alpine_bits_python.alpinebits_server import AlpineBitsServer, AlpineBitsClientInfo
@@ -34,14 +35,17 @@ async def test_ping_action_response_matches_expected():
) )
actual_obj = extract_relevant_sections(response.xml_content) actual_obj = extract_relevant_sections(response.xml_content)
expected_obj = extract_relevant_sections(expected_xml) expected_obj = extract_relevant_sections(expected_xml)
# log failures to xml files in test_output for easier debugging
if actual_obj != expected_obj:
with open("test/test_output/actual_ping_response.xml", "w", encoding="utf-8") as f:
f.write(response.xml_content)
with open("test/test_output/expected_ping_response.xml", "w", encoding="utf-8") as f:
f.write(expected_xml)
assert actual_obj == expected_obj actual_matches = actual_obj.warnings.warning
expected_matches = expected_obj.warnings.warning
assert actual_matches == expected_matches, f"Expected warnings {expected_matches}, got {actual_matches}"
actual_capabilities = actual_obj.echo_data
expected_capabilities = expected_obj.echo_data
assert actual_capabilities == expected_capabilities, f"Expected echo data {expected_capabilities}, got {actual_capabilities}"
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_ping_action_response_success(): async def test_ping_action_response_success():