Пример #1
0
    def test_confirm_yes(self):
        # Override the raw_input used in utils
        def custom_raw_input(_):
            return 'Yes'

        utils.raw_input = custom_raw_input
        assert utils.confirm('Answer Yes to this question')
Пример #2
0
    def test_confirm_typo(self):
        # Override the raw_input used in utils
        def custom_raw_input(_):
            return 'No'

        utils.raw_input = custom_raw_input
        assert not utils.confirm('Answer garbage to this question')
Пример #3
0
    def test_confirm_typo(self):
        # Override the input used in utils
        def custom_input(_):
            return "No"

        utils.input = custom_input
        assert not utils.confirm("Answer garbage to this question")
Пример #4
0
    def test_confirm_no(self):
        # Override the input used in utils
        def custom_input(_):
            return 'No'

        utils.input = custom_input
        assert not utils.confirm('Answer No to this question')
Пример #5
0
    def test_confirm_yes(self):
        # Override the input used in utils
        def custom_input(_):
            return "Yes"

        utils.input = custom_input
        assert utils.confirm("Answer Yes to this question")
Пример #6
0
    def test_confirm_typo(self):
        # Override the raw_input used in utils
        def custom_raw_input(_):
            return "No"

        utils.raw_input = custom_raw_input
        assert not utils.confirm("Answer garbage to this question")
Пример #7
0
    def test_confirm_yes(self):
        # Override the raw_input used in utils
        def custom_raw_input(_):
            return "Yes"

        utils.raw_input = custom_raw_input
        assert utils.confirm("Answer Yes to this question")
Пример #8
0
 def test_confirm_no(self):
     # Override the raw_input used in utils
     def custom_raw_input(_):
         return 'No'
     utils.raw_input = custom_raw_input
     assert not utils.confirm('Answer No to this question')
Пример #9
0
 def test_confirm_typo(self):
     # Override the input used in utils
     def custom_input(_):
         return 'No'
     utils.input = custom_input
     assert not utils.confirm('Answer garbage to this question')
Пример #10
0
 def test_confirm_yes(self):
     # Override the input used in utils
     def custom_input(_):
         return 'Yes'
     utils.input = custom_input
     assert utils.confirm('Answer Yes to this question')