Argument parsing test got broken
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
504811a32c
commit
639ad2b3bd
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue