MCPcopy Index your code
hub / github.com/python/cpython / test_cmpfiles_invalid_names

Method test_cmpfiles_invalid_names

Lib/test/test_filecmp.py:159–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

157 "Comparing mismatched directories fails")
158
159 def test_cmpfiles_invalid_names(self):
160 # See https://github.com/python/cpython/issues/122400.
161 for file, desc in [
162 ('\x00', 'NUL bytes filename'),
163 (__file__ + '\x00', 'filename with embedded NUL bytes'),
164 ("\uD834\uDD1E.py", 'surrogate codes (MUSICAL SYMBOL G CLEF)'),
165 ('a' * 1_000_000, 'very long filename'),
166 ]:
167 for other_dir in [self.dir, self.dir_same, self.dir_diff]:
168 with self.subTest(f'cmpfiles: {desc}', other_dir=other_dir):
169 res = filecmp.cmpfiles(self.dir, other_dir, [file])
170 self.assertTupleEqual(res, ([], [], [file]))
171
172 def test_dircmp_invalid_names(self):
173 for bad_dir, desc in [

Callers

nothing calls this directly

Calls 2

assertTupleEqualMethod · 0.80
subTestMethod · 0.45

Tested by

no test coverage detected