#NEWLINE# @ mock . patch ( 'fcntl.lockf' ) #NEWLINE# @ mock . patch ( 'socket.fromfd' ) #NEWLINE# def test_unix_socket_init_lock( fromfd , lockf ) : #NEWLINE# #INDENT# s = fromfd . return_value #NEWLINE# sock . UnixSocket ( 'test.sock' , mock . Mock ( ) , mock . Mock ( ) , mock . Mock ( ) ) #NEWLINE# lockf . assert_called_with ( s , ( fcntl . LOCK_SH | fcntl . LOCK_NB ) )