Skip to content

Commit

Permalink
confirm form
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Dec 9, 2018
1 parent 86154f7 commit 232adcd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@


def example_form(inp):
return form(q1=questionary.text("Hello?",
input=inp,
output=DummyOutput()),
return form(q1=questionary.confirm("Hello?",
input=inp,
output=DummyOutput()),
q2=questionary.select("World?",
choices=["foo", "bar"],
input=inp,
Expand All @@ -20,15 +20,15 @@ def example_form(inp):

def test_form_creation():
inp = create_pipe_input()
text = "Y" + KeyInputs.ENTER + KeyInputs.ENTER + "\r"
text = "Y" + KeyInputs.ENTER + "\r"

try:
inp.send_text(text)
f = example_form(inp)

result = f.unsafe_ask()

assert result == {'q1': 'y', 'q2': 'foo'}
assert result == {'q1': True, 'q2': 'foo'}
finally:
inp.close()

Expand Down

0 comments on commit 232adcd

Please sign in to comment.