#NEWLINE# def test_is_shape( ) : #NEWLINE# #INDENT# shape = ( 10 , 2 ) #NEWLINE# ig_0 = ( ( - 1 ) , 2 ) #NEWLINE# ig_1 = ( 10 , ( - 1 ) ) #NEWLINE# ig_2 = ( None , 2 ) #NEWLINE# ig_3 = ( 10 , None ) #NEWLINE# shapes = [ shape , ig_0 , ig_1 , ig_2 , ig_3 ] #NEWLINE# df = pd . DataFrame ( np . random . randn ( * shape ) ) #NEWLINE# for shp in shapes : #NEWLINE# #INDENT# tm . assert_frame_equal ( df , ck . is_shape ( df , shp ) ) #NEWLINE# #UNINDENT# for shp in shapes : #NEWLINE# #INDENT# result = dc . is_shape ( shape = shp ) ( _add_n ) ( df ) #NEWLINE# tm . assert_frame_equal ( result , ( df + 1 ) ) #NEWLINE# #UNINDENT# with pytest . raises ( AssertionError ) : #NEWLINE# #INDENT# ck . is_shape ( df , ( 9 , 2 ) ) #NEWLINE# #UNINDENT# with pytest . raises ( AssertionError ) : #NEWLINE# #INDENT# dc . is_shape ( ( 9 , 2 ) ) ( _add_n ) ( df )