mirror of https://github.com/vacp2p/wakurtosis.git
refactored arg_parser.py test
This commit is contained in:
parent
4e7c9c8999
commit
2b2f534feb
|
@ -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")
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue