Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenLooman committed Mar 22, 2024
1 parent 7f8a202 commit bebb5c9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,14 @@ async def test_response_invalid_xml_namespaces(self) -> None:
"""Test parsing response with invalid XML namespaces."""
requester = UpnpTestRequester(RESPONSE_MAP)
device_url = "http://igd:1234/device.xml"
service_type = "urn:schemas-upnp-org:service:RenderingControl:1"
service_type = "urn:schemas-upnp-org:service:WANIPConnection:1"
test_action = "DeletePortMapping"

# Test strict mode.
factory = UpnpFactory(requester)
device = await factory.async_create_device(device_url)
service = device.service(service_type)
service = device.find_service(service_type)
assert service is not None
action = service.action(test_action)

response = read_file("igd/action_WANPIPConnection_DeletePortMapping.xml")
Expand All @@ -582,8 +583,9 @@ async def test_response_invalid_xml_namespaces(self) -> None:

# Test non-strict mode.
factory = UpnpFactory(requester, non_strict=True)
device = await factory.async_create_device(link_service)
service = device.service(service_type)
device = await factory.async_create_device(device_url)
service = device.find_service(service_type)
assert service is not None
action = service.action(test_action)

try:
Expand Down

0 comments on commit bebb5c9

Please sign in to comment.