From 200ac5c9df4b8175844f72fbc417040ee93b617b Mon Sep 17 00:00:00 2001 From: TJ Porter Date: Wed, 3 Jan 2024 12:55:04 -0600 Subject: [PATCH] Resolves #144 [FIX] Fixed some VoIPPhoneParameters being tuples --- pyVoIP/VoIP/phone.py | 6 +++--- tests/test_functionality.py | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pyVoIP/VoIP/phone.py b/pyVoIP/VoIP/phone.py index bf2ae51..3d651cf 100644 --- a/pyVoIP/VoIP/phone.py +++ b/pyVoIP/VoIP/phone.py @@ -43,9 +43,9 @@ class VoIPPhoneParameter: credentials_manager: Optional[CredentialsManager] bind_ip: Optional[str] = "0.0.0.0" bind_port: Optional[int] = 5060 - bind_network: Optional[str] = "0.0.0.0/0", - hostname: Optional[str] = None, - remote_hostname: Optional[str] = None, + bind_network: Optional[str] = "0.0.0.0/0" + hostname: Optional[str] = None + remote_hostname: Optional[str] = None transport_mode: Optional[TransportMode] = TransportMode.UDP cert_file: Optional[str] = None key_file: Optional[str] = None diff --git a/tests/test_functionality.py b/tests/test_functionality.py index 67cdda5..0f9f91b 100644 --- a/tests/test_functionality.py +++ b/tests/test_functionality.py @@ -44,8 +44,8 @@ def phone(): cm = CredentialsManager() cm.add("pass", "Testing123!") voip_phone_parameter = VoIPPhoneParameter( - server="127.0.0.1", - port=5060, + server=SERVER_HOST, + port=UDP_PORT, user="pass", credentials_manager=cm, hostname="host.docker.internal", @@ -61,8 +61,8 @@ def phone(): @pytest.fixture def nopass_phone(): voip_phone_parameter = VoIPPhoneParameter( - server="127.0.0.1", - port=5060, + server=SERVER_HOST, + port=UDP_PORT, user="nopass", credentials_manager=CredentialsManager(), hostname="host.docker.internal", @@ -80,8 +80,8 @@ def nopass_phone(): @pytest.mark.skipif(TEST_CONDITION, reason=REASON) def test_nopass(): voip_phone_parameter = VoIPPhoneParameter( - server="127.0.0.1", - port=5060, + server=SERVER_HOST, + port=UDP_PORT, user="nopass", credentials_manager=CredentialsManager(), hostname="host.docker.internal", @@ -107,8 +107,8 @@ def test_pass(): cm = CredentialsManager() cm.add("pass", "Testing123!") voip_phone_parameter = VoIPPhoneParameter( - server="127.0.0.1", - port=5060, + server=SERVER_HOST, + port=UDP_PORT, user="pass", credentials_manager=cm, hostname="host.docker.internal", @@ -132,8 +132,8 @@ def test_pass(): @pytest.mark.skipif(TEST_CONDITION, reason=REASON) def test_tcp_nopass(): voip_phone_parameter = VoIPPhoneParameter( - server="127.0.0.1", - port=5061, + server=SERVER_HOST, + port=TCP_PORT, user="nopass", credentials_manager=CredentialsManager(), hostname="host.docker.internal", @@ -160,8 +160,8 @@ def test_tcp_pass(): cm = CredentialsManager() cm.add("pass", "Testing123!") voip_phone_parameter = VoIPPhoneParameter( - server="127.0.0.1", - port=5061, + server=SERVER_HOST, + port=TCP_PORT, user="pass", credentials_manager=cm, hostname="host.docker.internal", @@ -186,8 +186,8 @@ def test_tcp_pass(): @pytest.mark.skipif(TEST_CONDITION, reason=REASON) def test_tls_nopass(): voip_phone_parameter = VoIPPhoneParameter( - server="127.0.0.1", - port=5062, + server=SERVER_HOST, + port=TLS_PORT, user="nopass", credentials_manager=CredentialsManager(), bind_ip=BIND_IP, @@ -216,8 +216,8 @@ def test_tls_pass(): cm = CredentialsManager() cm.add("pass", "Testing123!") voip_phone_parameter = VoIPPhoneParameter( - server="127.0.0.1", - port=5062, + server=SERVER_HOST, + port=TLS_PORT, user="pass", credentials_manager=cm, hostname="host.docker.internal",