MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_filetime

Method test_filetime

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

Source from the content-addressed store, hash-verified

110 self.assertEqual(self.pathmodule.getsize(filename), 12)
111
112 def test_filetime(self):
113 filename = os_helper.TESTFN
114 self.addCleanup(os_helper.unlink, filename)
115
116 create_file(filename, b'foo')
117
118 with open(filename, "ab", 0) as f:
119 f.write(b"bar")
120
121 with open(filename, "rb", 0) as f:
122 data = f.read()
123 self.assertEqual(data, b"foobar")
124
125 self.assertLessEqual(
126 self.pathmodule.getctime(filename),
127 self.pathmodule.getmtime(filename)
128 )
129
130 def test_exists(self):
131 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