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

Method test_filetime

Lib/test/test_genericpath.py:118–134  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

116 self.assertEqual(self.pathmodule.getsize(filename), 12)
117
118 def test_filetime(self):
119 filename = os_helper.TESTFN
120 self.addCleanup(os_helper.unlink, filename)
121
122 create_file(filename, b'foo')
123
124 with open(filename, "ab", 0) as f:
125 f.write(b"bar")
126
127 with open(filename, "rb", 0) as f:
128 data = f.read()
129 self.assertEqual(data, b"foobar")
130
131 self.assertLessEqual(
132 self.pathmodule.getctime(filename),
133 self.pathmodule.getmtime(filename)
134 )
135
136 def test_exists(self):
137 filename = os_helper.TESTFN

Callers

nothing calls this directly

Calls 7

addCleanupMethod · 0.80
assertLessEqualMethod · 0.80
create_fileFunction · 0.70
openFunction · 0.50
writeMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected