#NEWLINE# def test_extension_name_case_sensitive( self ) : #NEWLINE# #INDENT# '\n        Tests that setting fits.EXTENSION_NAME_CASE_SENSITIVE at runtime\n        works.\n        ' #NEWLINE# if ( 'PYFITS_EXTENSION_NAME_CASE_SENSITIVE' in os . environ ) : #NEWLINE# #INDENT# del os . environ [ 'PYFITS_EXTENSION_NAME_CASE_SENSITIVE' ] #NEWLINE# #UNINDENT# hdu = fits . ImageHDU ( ) #NEWLINE# hdu . name = 'sCi' #NEWLINE# assert ( hdu . name == 'SCI' ) #NEWLINE# assert ( hdu . header [ 'EXTNAME' ] == 'SCI' ) #NEWLINE# try : #NEWLINE# #INDENT# fits . EXTENSION_NAME_CASE_SENSITIVE = True #NEWLINE# hdu = fits . ImageHDU ( ) #NEWLINE# hdu . name = 'sCi' #NEWLINE# assert ( hdu . name == 'sCi' ) #NEWLINE# assert ( hdu . header [ 'EXTNAME' ] == 'sCi' ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# fits . EXTENSION_NAME_CASE_SENSITIVE = False #NEWLINE# #UNINDENT# hdu . name = 'sCi' #NEWLINE# assert ( hdu . name == 'SCI' ) #NEWLINE# assert ( hdu . header [ 'EXTNAME' ] == 'SCI' )