#NEWLINE# def test_group_slice( self ) : #NEWLINE# #INDENT# '\n        Tests basic slicing a single group record.\n        ' #NEWLINE# with fits . open ( self . data ( 'random_groups.fits' ) ) as hdul : #NEWLINE# #INDENT# g = hdul [ 0 ] . data [ 0 ] #NEWLINE# s = g [ 2 : 4 ] #NEWLINE# assert ( len ( s ) == 2 ) #NEWLINE# assert ( s [ 0 ] == g [ 2 ] ) #NEWLINE# assert ( s [ ( - 1 ) ] == g [ ( - 3 ) ] ) #NEWLINE# s = g [ : : ( - 1 ) ] #NEWLINE# assert ( len ( s ) == 6 ) #NEWLINE# assert ( s [ 0 ] == g [ ( - 1 ) ] ) . all ( ) #NEWLINE# assert ( s [ ( - 1 ) ] == g [ 0 ] ) #NEWLINE# s = g [ : : 2 ] #NEWLINE# assert ( len ( s ) == 3 ) #NEWLINE# assert ( s [ 0 ] == g [ 0 ] ) #NEWLINE# assert ( s [ 1 ] == g [ 2 ] ) #NEWLINE# assert ( s [ 2 ] == g [ 4 ] )