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

Method test_write_unicode_filenames

Lib/test/test_zipfile/test_core.py:1952–1960  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1950 zipfp.open(name).close()
1951
1952 def test_write_unicode_filenames(self):
1953 with zipfile.ZipFile(TESTFN, "w") as zf:
1954 zf.writestr("foo.txt", "Test for unicode filename")
1955 zf.writestr("\xf6.txt", "Test for unicode filename")
1956 self.assertIsInstance(zf.infolist()[0].filename, str)
1957
1958 with zipfile.ZipFile(TESTFN, "r") as zf:
1959 self.assertEqual(zf.filelist[0].filename, "foo.txt")
1960 self.assertEqual(zf.filelist[1].filename, "\xf6.txt")
1961
1962 def create_zipfile_with_extra_data(self, filename, extra_data_name):
1963 with zipfile.ZipFile(TESTFN, mode='w') as zf:

Callers

nothing calls this directly

Calls 4

writestrMethod · 0.80
assertIsInstanceMethod · 0.80
infolistMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected