Skip to content

Commit

Permalink
Fix missing key in set port command (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kane610 authored Jul 3, 2024
1 parent d2f8a84 commit aa9c2fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion axis/models/port_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def content(self) -> bytes:
"apiVersion": self.api_version,
"context": self.context,
"method": "setPorts",
"params": ports,
"params": {"ports": ports},
}
)

Expand Down
26 changes: 14 additions & 12 deletions tests/test_port_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def test_get_ports(respx_mock, io_port_management):
"method": "setPorts",
"apiVersion": "1.0",
"context": "Axis library",
"params": [{"port": "0", "state": "open"}],
"params": {"ports": [{"port": "0", "state": "open"}]},
}

await io_port_management.close("0")
Expand All @@ -67,7 +67,7 @@ async def test_get_ports(respx_mock, io_port_management):
"method": "setPorts",
"apiVersion": "1.0",
"context": "Axis library",
"params": [{"port": "0", "state": "closed"}],
"params": {"ports": [{"port": "0", "state": "closed"}]},
}


Expand Down Expand Up @@ -105,16 +105,18 @@ async def test_set_ports(respx_mock, io_port_management):
"method": "setPorts",
"apiVersion": "1.0",
"context": "Axis library",
"params": [
{
"port": "0",
"usage": "",
"direction": "",
"name": "",
"normalState": "",
"state": "closed",
}
],
"params": {
"ports": [
{
"port": "0",
"usage": "",
"direction": "",
"name": "",
"normalState": "",
"state": "closed",
}
]
},
}


Expand Down

0 comments on commit aa9c2fb

Please sign in to comment.