<s> import sys <EOL> from mock import patch <EOL> from . . utils import is_interactive <EOL> from nose . tools import assert_false , assert_true <EOL> def test_is_interactive_crippled_stdout ( ) : <EOL> class mocked_out ( object ) : <EOL> """<STR_LIT>""" <EOL> def write ( self , * args , ** kwargs ) : <EOL> pass <EOL> class mocked_isatty ( mocked_out ) : <EOL> def isatty ( self ) : <EOL> return True <EOL> for inout in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) : <EOL> with patch ( '<STR_LIT>' % inout , mocked_out ( ) ) : <EOL> assert_false ( is_interactive ( ) ) <EOL> with patch ( '<STR_LIT>' , mocked_isatty ( ) ) , patch ( '<STR_LIT>' , mocked_isatty ( ) ) , patch ( '<STR_LIT>' , mocked_isatty ( ) ) : <EOL> assert_true ( is_interactive ( ) ) </s>
