From bd067ba87b458f440a59d1c4668840dcb9e9a789 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Thu, 15 Apr 2021 13:34:37 -0500 Subject: Fix send_once issue where signal is sent twice --- tests/test_default_connection.py | 43 +++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'tests/test_default_connection.py') diff --git a/tests/test_default_connection.py b/tests/test_default_connection.py index bc4fa09..8488dd3 100644 --- a/tests/test_default_connection.py +++ b/tests/test_default_connection.py @@ -1,29 +1,32 @@ -from unittest.mock import patch import socket +from unittest.mock import patch + +import pytest from lirc.connection.default_connection import DefaultConnection from lirc.exceptions import UnsupportedOperatingSystemError -import pytest - -@pytest.mark.parametrize("os, expected_socket, expected_address", [ - ( - "Windows", - socket.socket(socket.AF_INET, socket.SOCK_STREAM), - ("localhost", 8765) - ), - ( - "Linux", - socket.socket(socket.AF_UNIX, socket.SOCK_STREAM), - "/var/run/lirc/lircd" - ), - ( - "Darwin", - socket.socket(socket.AF_UNIX, socket.SOCK_STREAM), - "/opt/run/var/run/lirc/lircd" - ) -]) +@pytest.mark.parametrize( + "os, expected_socket, expected_address", + [ + ( + "Windows", + socket.socket(socket.AF_INET, socket.SOCK_STREAM), + ("localhost", 8765), + ), + ( + "Linux", + socket.socket(socket.AF_UNIX, socket.SOCK_STREAM), + "/var/run/lirc/lircd", + ), + ( + "Darwin", + socket.socket(socket.AF_UNIX, socket.SOCK_STREAM), + "/opt/run/var/run/lirc/lircd", + ), + ], +) @patch("platform.system") def test_default_connection_has_correct_os_specific_socket_and_address( patched_system, os, expected_socket, expected_address -- cgit v1.2.3