tests/test-atomictempfile.py
changeset 29393 50269a4dce61
parent 29392 f21286e48bc6
child 29394 6d96658a22b0
equal deleted inserted replaced
29392:f21286e48bc6 29393:50269a4dce61
    87             # of file timestamp (or test happened to be executed at
    87             # of file timestamp (or test happened to be executed at
    88             # bad timing). Exit silently in this case, because running
    88             # bad timing). Exit silently in this case, because running
    89             # on other faster platforms can detect problems
    89             # on other faster platforms can detect problems
    90             pass
    90             pass
    91 
    91 
       
    92     def testread(self):
       
    93         with open(self._filename, 'wb') as f:
       
    94             f.write(b'foobar\n')
       
    95         file = atomictempfile(self._filename, mode='rb')
       
    96         self.assertTrue(file.read(), b'foobar\n')
       
    97         file.discard()
       
    98 
    92 if __name__ == '__main__':
    99 if __name__ == '__main__':
    93     import silenttestrunner
   100     import silenttestrunner
    94     silenttestrunner.main(__name__)
   101     silenttestrunner.main(__name__)