#NEWLINE# def test_datacopied( self ) : #NEWLINE# #INDENT# from scipy.linalg.decomp import _datacopied #NEWLINE# M = matrix ( [ [ 0 , 1 ] , [ 2 , 3 ] ] ) #NEWLINE# A = asarray ( M ) #NEWLINE# L = M . tolist ( ) #NEWLINE# M2 = M . copy ( ) #NEWLINE# class Fake1 ( ) : #NEWLINE# #INDENT# def __array__( self ) : #NEWLINE# #INDENT# return A #NEWLINE# #UNINDENT# #UNINDENT# class Fake2 ( ) : #NEWLINE# #INDENT# __array_interface__ = A . __array_interface__ #NEWLINE# #UNINDENT# F1 = Fake1 ( ) #NEWLINE# F2 = Fake2 ( ) #NEWLINE# for ( item , status ) in [ ( status , False ) , ( A , False ) , ( L , True ) , ( M2 , False ) , ( F1 , False ) , ( F2 , False ) ] : #NEWLINE# #INDENT# arr = asarray ( item ) #NEWLINE# assert_equal ( _datacopied ( arr , item ) , status , err_msg = repr ( item ) )