<s> from flask . ext . alchemydumps . helpers . confirm import confirm <EOL> from unittest import TestCase <EOL> try : <EOL> from unittest . mock import patch <EOL> input_function = '<STR_LIT>' <EOL> except ImportError : <EOL> from mock import patch <EOL> input_function = '<STR_LIT>' <EOL> class TestConfirmHelper ( TestCase ) : <EOL> @ patch ( input_function ) <EOL> def test_no_auto_confirm_upper ( self , mocked_input ) : <EOL> mocked_input . return_value = '<STR_LIT:Y>' <EOL> self . assertTrue ( confirm ( ) ) <EOL> @ patch ( input_function ) <EOL> def test_no_auto_confirm_lower ( self , mocked_input ) : <EOL> mocked_input . return_value = '<STR_LIT:y>' <EOL> self . assertTrue ( confirm ( ) ) <EOL> @ patch ( input_function ) <EOL> def test_no_auto_do_not_confirm ( self , mocked_input ) : <EOL> mocked_input . return_value = '<STR_LIT:x>' <EOL> self . assertFalse ( confirm ( ) ) <EOL> @ patch ( input_function ) <EOL> def test_no_auto_do_blank ( self , mocked_input ) : <EOL> mocked_input . return_value = '<STR_LIT>' <EOL> self . assertFalse ( confirm ( ) ) <EOL> @ patch ( input_function ) <EOL> def test_auto_confirm ( self , mocked_input ) : <EOL> mocked_input . return_value = '<STR_LIT>' <EOL> self . assertTrue ( confirm ( True ) ) <EOL> self . assertTrue ( confirm ( '<STR_LIT:Y>' ) ) <EOL> self . assertTrue ( confirm ( <NUM_LIT:1> ) ) <EOL> self . assertFalse ( confirm ( False ) ) <EOL> self . assertFalse ( confirm ( <NUM_LIT:0> ) ) <EOL> self . assertFalse ( confirm ( '<STR_LIT>' ) ) </s>
