Exemplo n.º 1
0
 def __bool__(self) -> bool:
     if self.value == self.Options.ask:
         return bool(
             prompt.ask_question(title=self._title, body=self._question))
     if self.value == self.Options.false:
         return False
     return True
Exemplo n.º 2
0
def test_ask_question(answer):
    title = "Question"
    body = "Does this test work?"
    answerer = QuestionAnswerer(title=title, body=body, answer=answer)
    received_answer = prompt.ask_question(title=title, body=body)
    assert answerer.answered
    assert received_answer == answer