#NEWLINE# def test_entity_mgr_find_all_checks( self ) : #NEWLINE# #INDENT# ent = self . entity #NEWLINE# mgr = ent . _check_manager #NEWLINE# c1 = fakes . FakeCloudMonitorCheck ( entity = ent , info = { #NEWLINE# #INDENT# 'foo' : 'fake' , #NEWLINE# 'bar' : 'fake' , #NEWLINE# #UNINDENT# } ) #NEWLINE# c2 = fakes . FakeCloudMonitorCheck ( entity = ent , info = { #NEWLINE# #INDENT# 'foo' : 'fake' , #NEWLINE# #UNINDENT# } ) #NEWLINE# c3 = fakes . FakeCloudMonitorCheck ( entity = ent , info = { #NEWLINE# #INDENT# 'foo' : 'fake' , #NEWLINE# 'bar' : 'real' , #NEWLINE# #UNINDENT# } ) #NEWLINE# mgr . list = Mock ( return_value = [ c1 , c2 , c3 ] ) #NEWLINE# found = mgr . find_all_checks ( foo = 'fake' , bar = 'fake' ) #NEWLINE# self . assertEqual ( len ( found ) , 1 ) #NEWLINE# self . assertTrue ( ( c1 in found ) ) #NEWLINE# self . assertTrue ( ( c2 not in found ) ) #NEWLINE# self . assertTrue ( ( c3 not in found ) )