From 17017d6962fda37cbd103c9b6985746439a20a13 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 29 Sep 2022 11:37:54 -0400 Subject: [PATCH] UT: Add missing SocketAddress tests for invalid ports --- monkey/tests/unit_tests/common/test_socket_address.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/tests/unit_tests/common/test_socket_address.py b/monkey/tests/unit_tests/common/test_socket_address.py index 6c3b2d448..7d8b20e3f 100644 --- a/monkey/tests/unit_tests/common/test_socket_address.py +++ b/monkey/tests/unit_tests/common/test_socket_address.py @@ -5,7 +5,7 @@ from common.types import SocketAddress GOOD_IP = "192.168.1.1" BAD_IP = "192.168.1.999" GOOD_PORT = 1234 -BAD_PORT = 99999 +BAD_PORTS = [99999, 0, -1] def test_socket_address__from_string(): @@ -26,7 +26,7 @@ def test_socket_address__from_string(): f"{GOOD_IP}:", f":{GOOD_PORT}", f"{BAD_IP}:{GOOD_PORT}", - f"{GOOD_IP}:{BAD_PORT}", + *[f"{GOOD_IP}:{bad_port}" for bad_port in BAD_PORTS], ], ) def test_socket_address__from_string_raises(bad_address: str):