#NEWLINE# def test_maybe_fileno( self ) : #NEWLINE# #INDENT# self . assertEqual ( utils . maybe_fileno ( 3 ) , 3 ) #NEWLINE# f = Mock ( name = 'file' ) #NEWLINE# self . assertIs ( utils . maybe_fileno ( f ) , f . fileno ( ) ) #NEWLINE# f . fileno . side_effect = ValueError ( ) #NEWLINE# self . assertIsNone ( utils . maybe_fileno ( f ) )