Exemplo n.º 1
0
 def _get_input(self, prompt):
     """
     Helper method to take input if input is a tty
     """
     if is_term():
         return raw_input(prompt)
     return 'y'
Exemplo n.º 2
0
 def test_is_term_has_fileno(self):
     with tempfile.TemporaryFile() as fd:
         save = sys.stdout
         sys.stdout = fd
         assert_equals(False, utils.is_term())
         sys.stdout = save
Exemplo n.º 3
0
 def test_is_term_not_term(self):
     # Default under nostests is no
     assert_equals(False, utils.is_term())