mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-28 02:38:43 +00:00
tests: TestBuildFilter: Adjust from item_is_hardlink_master to peek_and_store_hardlink_masters.
This commit is contained in:
parent
a026febdb0
commit
b845a074cb
1 changed files with 4 additions and 4 deletions
|
@ -2204,25 +2204,25 @@ def ccc(a, b):
|
||||||
|
|
||||||
class TestBuildFilter:
|
class TestBuildFilter:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def item_is_hardlink_master(item):
|
def peek_and_store_hardlink_masters(item):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def test_basic(self):
|
def test_basic(self):
|
||||||
matcher = PatternMatcher()
|
matcher = PatternMatcher()
|
||||||
matcher.add([parse_pattern('included')], True)
|
matcher.add([parse_pattern('included')], True)
|
||||||
filter = Archiver.build_filter(matcher, self.item_is_hardlink_master, 0)
|
filter = Archiver.build_filter(matcher, self.peek_and_store_hardlink_masters, 0)
|
||||||
assert filter(Item(path='included'))
|
assert filter(Item(path='included'))
|
||||||
assert filter(Item(path='included/file'))
|
assert filter(Item(path='included/file'))
|
||||||
assert not filter(Item(path='something else'))
|
assert not filter(Item(path='something else'))
|
||||||
|
|
||||||
def test_empty(self):
|
def test_empty(self):
|
||||||
matcher = PatternMatcher(fallback=True)
|
matcher = PatternMatcher(fallback=True)
|
||||||
filter = Archiver.build_filter(matcher, self.item_is_hardlink_master, 0)
|
filter = Archiver.build_filter(matcher, self.peek_and_store_hardlink_masters, 0)
|
||||||
assert filter(Item(path='anything'))
|
assert filter(Item(path='anything'))
|
||||||
|
|
||||||
def test_strip_components(self):
|
def test_strip_components(self):
|
||||||
matcher = PatternMatcher(fallback=True)
|
matcher = PatternMatcher(fallback=True)
|
||||||
filter = Archiver.build_filter(matcher, self.item_is_hardlink_master, strip_components=1)
|
filter = Archiver.build_filter(matcher, self.peek_and_store_hardlink_masters, strip_components=1)
|
||||||
assert not filter(Item(path='shallow'))
|
assert not filter(Item(path='shallow'))
|
||||||
assert not filter(Item(path='shallow/')) # can this even happen? paths are normalized...
|
assert not filter(Item(path='shallow/')) # can this even happen? paths are normalized...
|
||||||
assert filter(Item(path='deep enough/file'))
|
assert filter(Item(path='deep enough/file'))
|
||||||
|
|
Loading…
Reference in a new issue