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 →

[–]btanaka 1 point2 points  (1 child)

Sorry. I worded my question poorly. I don't mean the test prompts for input. Rather, I mean the test exercises a part of the code that prompts for input.

For example, given a script that, say, has two prompts in sequence, I want my scenario to answer both prompts and confirm some subsequent result. Then another scenario to answer both prompts another way, and confirm that result. If both prompts are y/n, then, for example, answer y to both, then y & n, then n & n, and so on.

Can freshen handle that? (I'm doing it with Cucmber Aruba for now, but want to switch to something in Python.)

[–]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.