#NEWLINE# @ fake_tasks ( fake_rpc = False , mock_rpc = False ) #NEWLINE# @ patch ( 'nailgun.rpc.cast' ) #NEWLINE# def test_nodes_in_cluster( self , mocked_rpc ) : #NEWLINE# #INDENT# cluster = self . env . create ( cluster_kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , nodes_kwargs = [ { #NEWLINE# #INDENT# 'api' : False , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'api' : False , #NEWLINE# 'pending_addition' : True , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'api' : False , #NEWLINE# 'cluster_id' : None , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# for node in self . env . nodes [ : 2 ] : #NEWLINE# #INDENT# cluster . nodes . append ( node ) #NEWLINE# #UNINDENT# self . db . add ( cluster ) #NEWLINE# self . db . commit ( ) #NEWLINE# self . assertEqual ( len ( cluster . nodes ) , 2 )