44
55"""tests that verify the connect behavior w.r.t. port number and TLS"""
66
7- import pytest
87import socket
98import ssl
109from unittest .mock import Mock , call , patch
1110
11+ import pytest
1212import adafruit_minimqtt .adafruit_minimqtt as MQTT
1313
1414
@@ -17,6 +17,7 @@ class TestPortSslSetup:
1717 These tests assume that there is no MQTT broker running on the hosts/ports they connect to.
1818 """
1919
20+ # pylint: disable=no-self-use
2021 def test_default_port (self ) -> None :
2122 """verify default port value and that TLS is not used"""
2223 host = "127.0.0.1"
@@ -44,6 +45,7 @@ def test_default_port(self) -> None:
4445 # Assuming the repeated calls will have the same arguments.
4546 connect_mock .assert_has_calls ([call ((host , expected_port ))])
4647
48+ # pylint: disable=no-self-use
4749 def test_connect_override (self ):
4850 """Test that connect() can override host and port."""
4951 host = "127.0.0.1"
@@ -69,6 +71,7 @@ def test_connect_override(self):
6971 # Assuming the repeated calls will have the same arguments.
7072 connect_mock .assert_has_calls ([call ((expected_host , expected_port ))])
7173
74+ # pylint: disable=no-self-use
7275 @pytest .mark .parametrize ("port" , (None , 8883 ))
7376 def test_tls_port (self , port ) -> None :
7477 """verify that when is_ssl=True is set, the default port is 8883
@@ -104,6 +107,7 @@ def test_tls_port(self, port) -> None:
104107 # Assuming the repeated calls will have the same arguments.
105108 connect_mock .assert_has_calls ([call ((host , expected_port ))])
106109
110+ # pylint: disable=no-self-use
107111 def test_tls_without_ssl_context (self ) -> None :
108112 """verify that when is_ssl=True is set, the code will check that ssl_context is not None"""
109113 host = "127.0.0.1"
0 commit comments