test_os.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:kbe_server 作者: xiaohaoppy 项目源码 文件源码
def _test_utime_subsecond(self, set_time_func):
        asec, amsec = 1, 901
        atime = asec + amsec * 1e-3
        msec, mmsec = 2, 901
        mtime = msec + mmsec * 1e-3
        filename = self.fname
        os.utime(filename, (0, 0))
        set_time_func(filename, atime, mtime)
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", DeprecationWarning)
            os.stat_float_times(True)
        st = os.stat(filename)
        self.assertAlmostEqual(st.st_atime, atime, places=3)
        self.assertAlmostEqual(st.st_mtime, mtime, places=3)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号