~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-02 04:09:08 UTC
  • mfrom: (6046.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20110802040908-hqz2wr82nyrk14gk
(mbp) merge 2.3 and 2.4 to trunk (Martin Pool)

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):