예제 #1
0
 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'))
예제 #2
0
 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')
예제 #3
0
 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()
예제 #4
0
 def test_allows_everything_when_nothing_is_excluded(self):
     excluder = obnamlib.PathnameExcluder()
     self.assertEqual(excluder.exclude('/foo'), (False, None))
예제 #5
0
 def config_loaded(self):
     self.app.hooks.add_callback('backup-exclude', self.exclude)
     self.pathname_excluder = obnamlib.PathnameExcluder()
     self.patterns_have_been_compiled = False