Skip to content

Commit 29d0081

Browse files
committed
Fix mock xmlapi typeid argument handling
Update the test mock to accept the simplified positional xmlapi('t', rtype, typeid) call shape used by the port so the integration test reflects the real extension behavior.
1 parent 24861ff commit 29d0081

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

mock_dmidecodemod.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ def xmlapi(query_type, result_type, section=None, typeid=None):
8585
</dmi>"""
8686

8787
elif query_type == 't': # Type ID query
88+
# The real extension passes typeid as a positional argument in the
89+
# third slot when using the simplified xmlapi('t', rtype, tpid) API.
90+
if typeid is None and section is not None:
91+
typeid = section
8892
typeid_str = str(typeid)
8993
if typeid_str in test_data:
9094
return test_data[typeid_str]
@@ -105,4 +109,4 @@ def xmlapi(query_type, result_type, section=None, typeid=None):
105109

106110
# Mock other functions that might be imported
107111
version = "3.12.3 (ElementTree Port)"
108-
dmi = "Test DMI String"
112+
dmi = "Test DMI String"

0 commit comments

Comments
 (0)