tests/test-atomictempfile.py
changeset 30332 318a24b52eeb
parent 29394 6d96658a22b0
child 32279 68c43a416585
equal deleted inserted replaced
30331:b19291e5d506 30332:318a24b52eeb
    66                 continue
    66                 continue
    67 
    67 
    68             repetition = 3
    68             repetition = 3
    69 
    69 
    70             # repeat atomic write with checkambig=True, to examine
    70             # repeat atomic write with checkambig=True, to examine
    71             # whether st_mtime is advanced multiple times as expecetd
    71             # whether st_mtime is advanced multiple times as expected
    72             for j in xrange(repetition):
    72             for j in xrange(repetition):
    73                 atomicwrite(True)
    73                 atomicwrite(True)
    74             newstat = os.stat(self._filename)
    74             newstat = os.stat(self._filename)
    75             if oldstat.st_ctime != newstat.st_ctime:
    75             if oldstat.st_ctime != newstat.st_ctime:
    76                 # timestamp ambiguity was naturally avoided while repetition
    76                 # timestamp ambiguity was naturally avoided while repetition
    77                 continue
    77                 continue
    78 
    78 
    79             # st_mtime should be advanced "repetition" times, because
    79             # st_mtime should be advanced "repetition" times, because
    80             # all atomicwrite() occured at same time (in sec)
    80             # all atomicwrite() occurred at same time (in sec)
    81             self.assertTrue(newstat.st_mtime ==
    81             self.assertTrue(newstat.st_mtime ==
    82                             ((oldstat.st_mtime + repetition) & 0x7fffffff))
    82                             ((oldstat.st_mtime + repetition) & 0x7fffffff))
    83             # no more examination is needed, if assumption above is true
    83             # no more examination is needed, if assumption above is true
    84             break
    84             break
    85         else:
    85         else: