def test_find_all_rules(self): m = LCRuleManager() rule1 = "FAKE RULE" cookie1 = 1 switch_id1 = 10 status1 = RULE_STATUS_INSTALLING m.add_rule(cookie1, switch_id1, rule1, status1) rule2 = "TOTALLY REAL RULE" cookie2 = 2 switch_id2 = 20 status2 = RULE_STATUS_INSTALLING m.add_rule(cookie2, switch_id2, rule2, status2) rules = m._find_rules() print ">>>> rules: %s" % rules self.failUnlessEqual(len(rules), 2)
def test_find_all_empty_rules(self): # Immediately check for rules m = LCRuleManager() rules = m._find_rules() self.failUnlessEqual([], rules)