def test_allows_pathname_matching_both_exclusion_and_inclusion(self): excluder = obnamlib.PathnameExcluder() excluder.exclude_regexp('foo') excluder.allow_regexp('oo') self.assertTrue(excluder.exclude('/foo'), (False, 'oo'))
def test_excludes_pathname_matching_exclusion_pattern(self): excluder = obnamlib.PathnameExcluder() excluder.exclude_regexp('foo') excluded, pattern = excluder.exclude('/foobar') self.assertTrue(excluded) self.assertEqual(pattern, 'foo')
def config_loaded(self): self.app.hooks.add_callback('backup-exclude', self.exclude) self.pathname_excluder = obnamlib.PathnameExcluder() self.compile_exclusion_patterns() self.compile_inclusion_patterns()
def test_allows_everything_when_nothing_is_excluded(self): excluder = obnamlib.PathnameExcluder() self.assertEqual(excluder.exclude('/foo'), (False, None))
def config_loaded(self): self.app.hooks.add_callback('backup-exclude', self.exclude) self.pathname_excluder = obnamlib.PathnameExcluder() self.patterns_have_been_compiled = False