#NEWLINE# def test_rule_lookup( self ) : #NEWLINE# #INDENT# triggertype = ReactorModelTest . _create_save_triggertype ( ) #NEWLINE# trigger = ReactorModelTest . _create_save_trigger ( triggertype ) #NEWLINE# runnertype = ActionModelTest . _create_save_runnertype ( ) #NEWLINE# action = ActionModelTest . _create_save_action ( runnertype ) #NEWLINE# saved = ReactorModelTest . _create_save_rule ( trigger , action ) #NEWLINE# retrievedrules = Rule . query ( trigger = reference . get_str_resource_ref_from_model ( trigger ) ) #NEWLINE# self . assertEqual ( 1 , len ( retrievedrules ) , 'No rules found.' ) #NEWLINE# for retrievedrule in retrievedrules : #NEWLINE# #INDENT# self . assertEqual ( saved . id , retrievedrule . id , 'Incorrect rule returned.' ) #NEWLINE# #UNINDENT# ReactorModelTest . _delete ( [ saved , trigger , action , runnertype , triggertype ] )