コード例 #1
0
    def test_confirm(self):
        side_eff = ["HA!", "y"]
        builtins, inp = self.mock_input(side_eff=side_eff)

        result = ra.confirm("")
        assert inp.call_count == 2
        assert result == True
コード例 #2
0
    def test_confirm_false(self):
        side_eff = ["n"]
        builtins, inp = self.mock_input(side_eff=side_eff)

        result = ra.confirm("")
        assert result == False