def test_invalid_tls_ver(self): """Bad tls versions raise exception """ args = {"tls_version": "custom_tls"} with pytest.raises(exceptions.MQTTTLSError): _handle_tls_args(args)
def test_disabled_tls(self): """Even if there are other invalid options, disable tls and early exit without checking other args """ args = {"certfile": "/lcliueurhug/ropko3kork32", "enable": False} parsed_args = _handle_tls_args(args) assert not parsed_args
def test_missing_cert_gives_error(self): """Missing TLS cert gives an error""" args = {"certfile": "/lcliueurhug/ropko3kork32"} with pytest.raises(exceptions.MQTTTLSError): _handle_tls_args(args)