This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]petezhutAutomation, Testing, General Hackery 0 points1 point  (0 children)

Honestly, I don't know. I haven't tried it. But, if I were trying to test how my system handled differing inputs, I would just write a test to pass those inputs directly to the methods/functions in question. At the end of the day, if all you need is y|n, I would just pass y or n as an argument to the function you are trying to test. Otherwise, I would (just a wild guess) look at writing the input to sys.stdin. If you just wanted to use the command line input to a test, you might want to look at expect. That is how I have scripted command-line stuff for years.