From 639ad2b3bd0ac96e13d337879b60638e5a00280f Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 21 Dec 2020 16:04:05 +0100 Subject: [PATCH] Argument parsing test got broken Signed-off-by: Yohann D'ANELLO --- squinnondation/squinnondation.py | 2 +- squinnondation/test/squinnondation_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/squinnondation/squinnondation.py b/squinnondation/squinnondation.py index 15b3300..32b82d1 100644 --- a/squinnondation/squinnondation.py +++ b/squinnondation/squinnondation.py @@ -39,7 +39,7 @@ class Squinnondation: help="Don't replace emojis.") self.args = parser.parse_args() - if not (1024 <= self.args.bind_port <= 65535) and (1024 <= self.args.client_port <= 65535): + if not (1024 <= self.args.bind_port <= 65535) or not (1024 <= self.args.client_port <= 65535): raise ValueError("Ports must be between 1024 and 65535.") self.bind_address = self.args.bind_address diff --git a/squinnondation/test/squinnondation_test.py b/squinnondation/test/squinnondation_test.py index 0e88607..410e015 100644 --- a/squinnondation/test/squinnondation_test.py +++ b/squinnondation/test/squinnondation_test.py @@ -26,5 +26,5 @@ class TestSquinnondation(unittest.TestCase): squinnondation.parse_arguments() self.assertEqual(squinnondation.bind_address, "localhost") self.assertEqual(squinnondation.bind_port, 4242) - self.assertEqual(squinnondation.client_address, "localhost") - self.assertEqual(squinnondation.client_port, 2500) + self.assertEqual(squinnondation.args.client_address, "localhost") + self.assertEqual(squinnondation.args.client_port, 2500)