#NEWLINE# def test_extver_extlevel( self ) : #NEWLINE# #INDENT# 'Test getting/setting the EXTVER and EXTLEVEL of and HDU.' #NEWLINE# h1 = fits . PrimaryHDU ( ) #NEWLINE# assert ( h1 . ver == 1 ) #NEWLINE# assert ( h1 . level == 1 ) #NEWLINE# assert ( 'EXTVER' not in h1 . header ) #NEWLINE# assert ( 'EXTLEVEL' not in h1 . header ) #NEWLINE# h1 . ver = 2 #NEWLINE# assert ( h1 . header . get ( 'EXTVER' ) == 2 ) #NEWLINE# h1 . header [ 'EXTVER' ] = 3 #NEWLINE# assert ( h1 . ver == 3 ) #NEWLINE# del h1 . header [ 'EXTVER' ] #NEWLINE# ( h1 . ver == 1 ) #NEWLINE# h1 . level = 2 #NEWLINE# assert ( h1 . header . get ( 'EXTLEVEL' ) == 2 ) #NEWLINE# h1 . header [ 'EXTLEVEL' ] = 3 #NEWLINE# assert ( h1 . level == 3 ) #NEWLINE# del h1 . header [ 'EXTLEVEL' ] #NEWLINE# assert ( h1 . level == 1 ) #NEWLINE# assert_raises ( TypeError , setattr , h1 , 'ver' , 'FOO' ) #NEWLINE# assert_raises ( TypeError , setattr , h1 , 'level' , 'BAR' )