MCPcopy Create free account
hub / github.com/rthalley/dnspython / compare_files

Function compare_files

tests/test_zone.py:323–332  ·  view source on GitHub ↗
(test_name, a_name, b_name)

Source from the content-addressed store, hash-verified

321
322
323def compare_files(test_name, a_name, b_name):
324 with open(a_name, encoding="utf-8") as a:
325 with open(b_name, encoding="utf-8") as b:
326 differences = list(difflib.unified_diff(a.readlines(), b.readlines()))
327 if len(differences) == 0:
328 return True
329 else:
330 print(f"{test_name} differences:")
331 sys.stdout.writelines(differences)
332 return False
333
334
335class ZoneTestCase(unittest.TestCase):

Callers 8

testFromFile1Method · 0.85
testFromFile2Method · 0.85
testToFileTextualMethod · 0.85
testToFileBinaryMethod · 0.85
testToFileFilenameMethod · 0.85
testToTextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…