#NEWLINE# def test_saving_loading_np_array2( self ) : #NEWLINE# #INDENT# 'Test saving and loading numpy arrays of higher dimension\n        ' #NEWLINE# random1 = np . random . rand ( 321 , 123 ) #NEWLINE# random2 = np . random . randint ( 0 , 100 , ( 123 , 345 ) ) #NEWLINE# state [ 'random1' ] = random1 #NEWLINE# state [ 'random2' ] = random2 #NEWLINE# with tempfile . NamedTemporaryFile ( ) as temp : #NEWLINE# #INDENT# state . save ( temp . name ) #NEWLINE# state . reset_instance ( ) #NEWLINE# self . assertNotIn ( 'random1' , state ) #NEWLINE# self . assertNotIn ( 'random2' , state ) #NEWLINE# state . load ( random2 . name , lazy = False ) #NEWLINE# self . assertTrue ( ( random1 == state [ 'random1' ] ) . all ( ) ) #NEWLINE# self . assertTrue ( ( random2 == state [ 'random2' ] ) . all ( ) ) #NEWLINE# self . assertEqual ( state [ 'random1' ] . shape , random1 . shape ) #NEWLINE# self . assertEqual ( state [ 'random2' ] . shape , random2 . shape ) #NEWLINE# self . assertEqual ( state [ 'random1' ] . dtype , random1 . dtype ) #NEWLINE# self . assertEqual ( state [ 'random2' ] . dtype , random2 . dtype )