~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: Martin Pool
  • Date: 2011-08-02 01:10:27 UTC
  • mfrom: (6015.9.4 2.4)
  • mto: This revision was merged to the branch mainline in revision 6047.
  • Revision ID: mbp@canonical.com-20110802011027-cv8b6h9q18ctxle4
merge up 2.3 and 2.4 into trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
740
740
        self.assertEquals(t.local_abspath(''), here)
741
741
 
742
742
 
 
743
class TestLocalTransportWriteStream(tests.TestCaseWithTransport):
 
744
 
 
745
    def test_local_fdatasync_calls_fdatasync(self):
 
746
        """Check fdatasync on a stream tries to flush the data to the OS.
 
747
        
 
748
        We can't easily observe the external effect but we can at least see
 
749
        it's called.
 
750
        """
 
751
        t = self.get_transport('.')
 
752
        calls = self.recordCalls(os, 'fdatasync')
 
753
        w = t.open_write_stream('out')
 
754
        w.write('foo')
 
755
        w.fdatasync()
 
756
        with open('out', 'rb') as f:
 
757
            # Should have been flushed.
 
758
            self.assertEquals(f.read(), 'foo')
 
759
        self.assertEquals(len(calls), 1, calls)
 
760
 
 
761
 
743
762
class TestWin32LocalTransport(tests.TestCase):
744
763
 
745
764
    def test_unc_clone_to_root(self):