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

Method testAppend

Lib/test/test_io/test_fileio.py:693–709  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

691 os.unlink(TESTFN)
692
693 def testAppend(self):
694 try:
695 f = self.FileIO(TESTFN, 'wb')
696 f.write(b'spam')
697 f.close()
698 f = self.FileIO(TESTFN, 'ab')
699 f.write(b'eggs')
700 f.close()
701 f = self.FileIO(TESTFN, 'rb')
702 d = f.read()
703 f.close()
704 self.assertEqual(d, b'spameggs')
705 finally:
706 try:
707 os.unlink(TESTFN)
708 except:
709 pass
710
711 def testInvalidInit(self):
712 self.assertRaises(TypeError, self.FileIO, "1", 0, 0)

Callers

nothing calls this directly

Calls 5

writeMethod · 0.95
closeMethod · 0.95
readMethod · 0.95
assertEqualMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected