Skip to content

Commit

Permalink
update name, listen_succeeded_alert_socket_type_t
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Oct 1, 2024
1 parent 2784433 commit 1d644d1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
20 changes: 10 additions & 10 deletions bindings/python/libtorrent/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -854,21 +854,21 @@ class listen_on_flags_t(int):
names: Mapping[str, listen_on_flags_t]
values: Mapping[int, listen_on_flags_t]

class listen_succeded_alert_socket_type_t(int):
i2p: listen_succeded_alert_socket_type_t
names: Mapping[str, listen_succeded_alert_socket_type_t]
socks5: listen_succeded_alert_socket_type_t
tcp: listen_succeded_alert_socket_type_t
tcp_ssl: listen_succeded_alert_socket_type_t
udp: listen_succeded_alert_socket_type_t
utp_ssl: listen_succeded_alert_socket_type_t
values: Mapping[int, listen_succeded_alert_socket_type_t]
class listen_succeeded_alert_socket_type_t(int):
i2p: listen_succeeded_alert_socket_type_t
names: Mapping[str, listen_succeeded_alert_socket_type_t]
socks5: listen_succeeded_alert_socket_type_t
tcp: listen_succeeded_alert_socket_type_t
tcp_ssl: listen_succeeded_alert_socket_type_t
udp: listen_succeeded_alert_socket_type_t
utp_ssl: listen_succeeded_alert_socket_type_t
values: Mapping[int, listen_succeeded_alert_socket_type_t]

class listen_succeeded_alert(alert):
address: str
endpoint: Tuple[str, int]
port: int
sock_type: listen_succeded_alert_socket_type_t
sock_type: listen_succeeded_alert_socket_type_t
socket_type: socket_type_t

class log_alert(alert):
Expand Down
30 changes: 15 additions & 15 deletions bindings/python/tests/alert_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,35 +144,35 @@ def test_operation_name(self) -> None:
continue
self.assertIsInstance(lt.operation_name(value), str)

def test_listen_succeded_alert_socket_type_t(self) -> None:
def test_listen_succeeded_alert_socket_type_t(self) -> None:
if lt.api_version < 2:
self.assertIsInstance(lt.listen_succeded_alert_socket_type_t.tcp, int)
self.assertIsInstance(lt.listen_succeded_alert_socket_type_t.tcp_ssl, int)
self.assertIsInstance(lt.listen_succeded_alert_socket_type_t.udp, int)
self.assertIsInstance(lt.listen_succeded_alert_socket_type_t.i2p, int)
self.assertIsInstance(lt.listen_succeded_alert_socket_type_t.socks5, int)
self.assertIsInstance(lt.listen_succeded_alert_socket_type_t.utp_ssl, int)
self.assertIsInstance(lt.listen_succeeded_alert_socket_type_t.tcp, int)
self.assertIsInstance(lt.listen_succeeded_alert_socket_type_t.tcp_ssl, int)
self.assertIsInstance(lt.listen_succeeded_alert_socket_type_t.udp, int)
self.assertIsInstance(lt.listen_succeeded_alert_socket_type_t.i2p, int)
self.assertIsInstance(lt.listen_succeeded_alert_socket_type_t.socks5, int)
self.assertIsInstance(lt.listen_succeeded_alert_socket_type_t.utp_ssl, int)

@unittest.skip("https://github.com/arvidn/libtorrent/issues/5967")
def test_listen_succeded_alert_socket_type_t_deprecated(self) -> None:
def test_listen_succeeded_alert_socket_type_t_deprecated(self) -> None:
if lt.api_version < 2:
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(lt.listen_succeded_alert_socket_type_t.tcp, int)
self.assertIsInstance(lt.listen_succeeded_alert_socket_type_t.tcp, int)
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(
lt.listen_succeded_alert_socket_type_t.tcp_ssl, int
lt.listen_succeeded_alert_socket_type_t.tcp_ssl, int
)
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(lt.listen_succeded_alert_socket_type_t.udp, int)
self.assertIsInstance(lt.listen_succeeded_alert_socket_type_t.udp, int)
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(lt.listen_succeded_alert_socket_type_t.i2p, int)
self.assertIsInstance(lt.listen_succeeded_alert_socket_type_t.i2p, int)
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(
lt.listen_succeded_alert_socket_type_t.socks5, int
lt.listen_succeeded_alert_socket_type_t.socks5, int
)
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(
lt.listen_succeded_alert_socket_type_t.utp_ssl, int
lt.listen_succeeded_alert_socket_type_t.utp_ssl, int
)

def test_listen_failed_alert_socket_type_t(self) -> None:
Expand Down Expand Up @@ -1283,7 +1283,7 @@ def test_listen_succeeded_alert(self) -> None:
if lt.api_version < 2:
self.assertEqual(alert.endpoint, ("127.0.0.1", self.session.listen_port()))
self.assertIsInstance(
alert.sock_type, lt.listen_succeded_alert_socket_type_t
alert.sock_type, lt.listen_succeeded_alert_socket_type_t
)
self.assertEqual(alert.address, "127.0.0.1")
self.assertEqual(alert.port, self.session.listen_port())
Expand Down

0 comments on commit 1d644d1

Please sign in to comment.