From 2b2f534febeac3a51e28b9dd055a7c79f8c564c6 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 5 May 2023 18:20:17 +0200 Subject: [PATCH] refactored arg_parser.py test --- analysis-module/tests/test_arg_parser.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/analysis-module/tests/test_arg_parser.py b/analysis-module/tests/test_arg_parser.py index 222f8dc..87a1625 100644 --- a/analysis-module/tests/test_arg_parser.py +++ b/analysis-module/tests/test_arg_parser.py @@ -8,8 +8,15 @@ from src import arg_parser class TestAnalysis(unittest.TestCase): - @patch('sys.argv', ['my_script.py', '-sp', 'test1', '-t', 'test2']) + @patch('sys.argv', ['my_script.py', '-sp', 'test1', '-p', '41234']) def test_parse_args(self): - sim, tomls = arg_parser.parse_args() + sim, port = arg_parser.parse_args() + print(sim, port) self.assertEqual(sim, "test1") - self.assertEqual(tomls, "test2") \ No newline at end of file + self.assertEqual(port, "41234") + + @patch('sys.argv', ['my_script.py']) + def test_parse_args_default(self): + sim, port = arg_parser.parse_args() + self.assertEqual(sim, "/simulation_data/") + self.assertEqual(port, None)