Beispiel #1
0
    def test_exclude(self):
        s = Selector(Config())
        c = Config()
        c.exclude = [re.compile(r'me')]
        s2 = Selector(c)

        assert s.matches('test_foo')
        assert s2.matches('test_foo')
        assert s.matches('test_me')
        assert not s2.matches('test_me')
Beispiel #2
0
 def test_exclude(self):
     s = Selector(Config())
     c = Config()
     c.exclude = [re.compile(r'me')]
     s2 = Selector(c)
     
     assert s.matches('test_foo')
     assert s2.matches('test_foo')
     assert s.matches('test_me')
     assert not s2.matches('test_me')
Beispiel #3
0
def BlacklistConfig(blacklist_file, excludes=()):
    config = Config()
    config.verbosity = 3
    config.plugins = BlacklistPlugins(blacklist_file)
    if excludes: config.exclude = map(re.compile, excludes)
    return config
Beispiel #4
0
def BlacklistConfig(blacklist_file, excludes=()):
    config = Config()
    config.verbosity = 3
    config.plugins = BlacklistPlugins(blacklist_file)
    if excludes: config.exclude = map(re.compile, excludes)
    return config