Example #1
0
    def test_display_horizontal(self, mock_stdin):
        question = MultipleChoiceQuestion(
            "What?", choices=["A", "B", "C", "D"], display="horizontal"
        )

        question.ask()
        mock_stdin.assert_called_with(
            "What?\na) A  b) B  c) C  d) D\nYour answer: "
        )
Example #2
0
    def test_display_vertical(self, mock_stdin):
        question = MultipleChoiceQuestion(
            "What?",
            choices=["A", "B", "C", "D"],
            display="vertical",
            option_indicator="-)",
        )

        question.ask()
        mock_stdin.assert_called_with(
            "What?\na-)A\nb-)B\nc-)C\nd-)D\nYour answer: "
        )
Example #3
0
    def test_display_none(self, mock_stdin):
        question = MultipleChoiceQuestion("What?", choices=["A"], display=None)
        question.ask()

        mock_stdin.assert_called_with("What?")
        self.assertIsNone(question.get_display())