/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: John Arbash Meinel
  • Date: 2010-01-05 22:13:12 UTC
  • mto: (4934.1.9 2.1.0rc1-set-mtime)
  • mto: This revision was merged to the branch mainline in revision 4940.
  • Revision ID: john@arbash-meinel.com-20100105221312-ez1orftbr65ws6yd
It turns out that with os/python/C buffering, we need to flush
Make the test compatibily with filesystems that only have 1s resolution.
Also, it seems on my Linux machine, .writelines() leaves data in buffers
that doesn't get written out until .close(). But that messes up the
timestamps. So now we call flush before we close.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
        fo.close()
155
155
        fo, st2 = self.wt.get_file_with_stat(None, path='two', filtered=False)
156
156
        fo.close()
 
157
        # We only guarantee 1s resolution
 
158
        self.assertEqual(int(transform._creation_mtime), int(st1.st_mtime))
 
159
        # But if we have more than that, all files should get the same result
157
160
        self.assertEqual(st1.st_mtime, st2.st_mtime)
158
 
        self.assertEqual(transform._creation_mtime, st1.st_mtime)
159
161
 
160
162
    def test_hardlink(self):
161
163
        self.requireFeature(HardlinkFeature)