I'm unit testing a part of code which asks for one argument at a time before bringing them back. I'd like to write a test that the prompt is what it should be, but I'm unsure how to test each stage of the prompt. Say the prompt is: "what is variable 1" --user input-- "what is variable 2" --user input--
Then the unit test would be something like..
with self.subTest(args=args):
result = _run(args)
self.assertRegex(result.stdout,r'(?m)^'what is variable 1?"
But when I try to submit just one variable at a time to 'args' then the test hangs. But when I try to submit all variables at once, the code fails and says "'what is variable 1' not found in ''"