MCPcopy
hub / github.com/borgbackup/borg / test_load_patterns_from_file

Function test_load_patterns_from_file

src/borg/testsuite/patterns_test.py:442–457  ·  view source on GitHub ↗
(tmpdir, lines, expected_roots, expected_numpatterns)

Source from the content-addressed store, hash-verified

440 ],
441)
442def test_load_patterns_from_file(tmpdir, lines, expected_roots, expected_numpatterns):
443 def evaluate(filename):
444 roots = []
445 inclexclpatterns = []
446 with open(filename) as f:
447 load_pattern_file(f, roots, inclexclpatterns)
448 return roots, len(inclexclpatterns)
449
450 patternfile = tmpdir.join("patterns.txt")
451
452 with patternfile.open("wt") as fh:
453 fh.write("\n".join(lines))
454
455 roots, numpatterns = evaluate(str(patternfile))
456 assert roots == expected_roots
457 assert numpatterns == expected_numpatterns
458
459
460def test_switch_patterns_style():

Callers

nothing calls this directly

Calls 3

evaluateFunction · 0.85
openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected