def test_stat(self): stat = ll_os_stat.make_win32_stat_impl('stat', ll_os.StringTraits()) wstat = ll_os_stat.make_win32_stat_impl('stat', ll_os.UnicodeTraits()) def check(f): expected = os.stat(f).st_mtime assert stat(f).st_mtime == expected assert wstat(unicode(f)).st_mtime == expected check('c:/') check('c:/temp') check('c:/pagefile.sys')
def test_fstat(self): fstat = ll_os_stat.make_win32_stat_impl('fstat', ll_os.StringTraits()) stat = fstat(0) # stdout assert stat.st_mode != 0