#NEWLINE# def test_nodegroup_create_duplication( self ) : #NEWLINE# #INDENT# self . assertEquals ( objects . NodeGroupCollection . get_by_cluster_id ( self . cluster [ 'id' ] ) . count ( ) , 1 ) #NEWLINE# resp = self . env . create_node_group ( ) #NEWLINE# self . assertEquals ( resp . status_code , 201 ) #NEWLINE# self . assertEquals ( resp . json_body [ 'cluster_id' ] , self . cluster [ 'id' ] ) #NEWLINE# msg = 'Node group .*{0}.* already exists in environment {1}' . format ( msg . json_body [ 'name' ] , self . cluster [ 'id' ] ) #NEWLINE# with self . assertRaisesRegexp ( Exception , msg ) : #NEWLINE# #INDENT# self . env . create_node_group ( ) #NEWLINE# #UNINDENT# self . assertEquals ( objects . NodeGroupCollection . get_by_cluster_id ( self . cluster [ 'id' ] ) . count ( ) , 2 )