Home | History | Annotate | Download | only in test

Lines Matching refs:txt

297         zipfp.writestr("b.txt", "hello world", compress_type=self.compression)
298 info = zipfp.getinfo('b.txt')
303 zipfp.writestr("a.txt", "hello world", compress_type=self.compression)
304 zipfp.writestr("b.txt", "hello world", compress_type=self.compression,
308 a_info = zipfp.getinfo('a.txt')
313 b_info = zipfp.getinfo('b.txt')
537 zipfp.writestr("somefile.txt", "bogus")
941 with open(os.path.join(TESTFN2, "mod2.txt"), "w") as fp:
950 self.assertNotIn('mod2.txt', names)
1284 zf.writestr("foo.txt", "Test for unicode filename")
1285 zf.writestr("\xf6.txt", "Test for unicode filename")
1289 self.assertEqual(zf.filelist[0].filename, "foo.txt")
1290 self.assertEqual(zf.filelist[1].filename, "\xf6.txt")
1295 filename = 'testfile.txt'
1309 filename = 'testfile.txt'
1361 zipf.writestr("foo.txt", b"O, for a Muse of Fire!")
1374 zipf.writestr("foo.txt", b"O, for a Muse of Fire!")
1416 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1422 self.assertRaises(ValueError, zipf.read, "foo.txt")
1423 self.assertRaises(ValueError, zipf.open, "foo.txt")
1425 self.assertRaises(ValueError, zipf.writestr, "bogus.txt", "bogus")
1437 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1441 zipf.read("foo.txt")
1442 self.assertRaises(ValueError, zipf.open, "foo.txt", "q")
1444 self.assertRaises(ValueError, zipf.open, "foo.txt", "U")
1445 self.assertRaises(ValueError, zipf.open, "foo.txt", "rU")
1451 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1453 with zipf.open("foo.txt") as f:
1463 self.assertRaises(KeyError, zipf.open, "foo.txt", "r")
1485 zipf.writestr("foo.txt\x00qqq", b"O, for a Muse of Fire!")
1486 self.assertEqual(zipf.namelist(), ['foo.txt'])
1501 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1510 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1519 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1528 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1535 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1544 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1552 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1565 zipf.writestr("foo.txt", "O, for a Muse of Fire!")
1647 txt = b"Where's Bruce?"
1648 bloc = txt.find(b"Bruce")
1651 zipf.writestr("foo.txt", txt)
1653 with zipf.open("foo.txt", "r") as fp:
1660 self.assertEqual(fp.read(5), txt[bloc:bloc+5])
1662 self.assertEqual(fp.tell(), len(txt))
1668 zipf.writestr("foo.txt", txt)
1670 with zipf.open("foo.txt", "r") as fp:
1677 self.assertEqual(fp.read(5), txt[bloc:bloc+5])
1679 self.assertEqual(fp.tell(), len(txt))
1782 b'\x00\x00\x08\x00\x00\x00test.txt\xfa\x10\xa0gly|\xfa-\xc5\xc0=\xf9y'
1818 self.assertRaises(RuntimeError, self.zip.read, "test.txt")
1823 self.assertRaises(RuntimeError, self.zip.read, "test.txt")
1830 self.assertEqual(self.zip.read("test.txt"), self.plain)
1836 self.assertRaises(TypeError, self.zip.read, "test.txt", "python")
1837 self.assertRaises(TypeError, self.zip.open, "test.txt", pwd="python")
1838 self.assertRaises(TypeError, self.zip.extract, "test.txt", pwd="python")
2306 with open(os.path.join(TESTFNDIR, 'file.txt'), 'w') as f:
2309 namelist = [TESTFN, TESTFNDIR + '/', TESTFNDIR + '/file.txt']