Esempio n. 1
0
    def test_cache_match(self):
        cache = s_cache.MatchCache()

        self.true(cache.match('foobar', 'foo*'))
        self.false(cache.match('foobar', '*baz'))

        self.true(cache.has(('foobar', 'foo*')))
        self.false(cache.has(('foobar', 'bazfaz')))
Esempio n. 2
0
 def __init__(self, rules):
     self._r_rules = rules
     self._r_match = s_cache.MatchCache()
     self._r_rules_by_perm = s_cache.Cache(onmiss=self._onRulesPermMiss)
Esempio n. 3
0
 def __init__(self):
     self._trig_list = []
     self._trig_match = s_cache.MatchCache()
     self._trig_byname = s_cache.Cache(onmiss=self._onTrigNameMiss)