Argument parsing test got broken

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2020-12-21 16:04:05 +01:00
parent 504811a32c
commit 639ad2b3bd
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class Squinnondation:
help="Don't replace emojis.") help="Don't replace emojis.")
self.args = parser.parse_args() 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.") raise ValueError("Ports must be between 1024 and 65535.")
self.bind_address = self.args.bind_address self.bind_address = self.args.bind_address

View File

@ -26,5 +26,5 @@ class TestSquinnondation(unittest.TestCase):
squinnondation.parse_arguments() squinnondation.parse_arguments()
self.assertEqual(squinnondation.bind_address, "localhost") self.assertEqual(squinnondation.bind_address, "localhost")
self.assertEqual(squinnondation.bind_port, 4242) self.assertEqual(squinnondation.bind_port, 4242)
self.assertEqual(squinnondation.client_address, "localhost") self.assertEqual(squinnondation.args.client_address, "localhost")
self.assertEqual(squinnondation.client_port, 2500) self.assertEqual(squinnondation.args.client_port, 2500)