#NEWLINE# def test_encode_group1( self ) : #NEWLINE# #INDENT# out = encode ( self . group1 ) #NEWLINE# assert isinstance ( out , dict ) #NEWLINE# assert ( out [ '__class__' ] == 'Group' ) #NEWLINE# assert ( out [ 'label' ] == 'a string' ) #NEWLINE# assert isinstance ( out [ 'x' ] , dict ) #NEWLINE# assert isinstance ( out [ 'opts' ] , dict ) #NEWLINE# assert ( out [ 'opts' ] [ '__class__' ] == 'Dict' ) #NEWLINE# assert ( out [ 'x' ] [ '__class__' ] == 'Array' ) #NEWLINE# assert ( out [ 'y' ] [ '__class__' ] == 'Array' ) #NEWLINE# assert_allclose ( out [ 'opts' ] [ 'a' ] , 1.0 , rtol = 0.0001 ) #NEWLINE# assert_allclose ( out [ 'x' ] [ 'value' ] [ : 3 ] , [ 0 , 0.5 , 1.0 ] , rtol = 0.0001 )