Example #1
0
 def testConditionMatch(self):
     # More general terms include more specific results.
     cond = triggers.Condition(*termos)
     self.assertTrue(cond.Match(*termos))
     self.assertTrue(cond.Match(*t800))
     self.assertTrue(cond.Match(*t1000))
     # More specific terms omit non-matching and more general ones.
     cond = triggers.Condition(*t800)
     self.assertTrue(cond.Match(*t800))
     self.assertFalse(cond.Match(*t1000))
     self.assertFalse(cond.Match(*termos))
Example #2
0
 def testConditionIsHashable(self):
     c1 = triggers.Condition(*termos)
     c2 = triggers.Condition(*t800)
     results = set([c1, c2, c1, c1, c1, c2])
     self.assertEqual(2, len(results))
     self.assertItemsEqual(set([c1, c2]), results)
Example #3
0
 def testConditionIsHashable(self):
     c1 = triggers.Condition(*termos)
     c2 = triggers.Condition(*t800)
     results = set([c1, c2, c1, c1, c1, c2])
     self.assertLen(results, 2)
     self.assertCountEqual(set([c1, c2]), results)