~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__dirstate_helpers.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-17 23:53:19 UTC
  • mfrom: (4805.1.4 2.1.0b4-win32-accepted)
  • Revision ID: pqm@pqm.ubuntu.com-20091117235319-z03oifdp0cybnhjm
(jam, Martin gz) More win32 fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
743
743
 
744
744
    def test_trailing_garbage(self):
745
745
        tree, state, expected = self.create_basic_dirstate()
746
 
        # We can modify the file as long as it hasn't been read yet.
 
746
        # On Linux, we can write extra data as long as we haven't read yet, but
 
747
        # on Win32, if you've opened the file with FILE_SHARE_READ, trying to
 
748
        # open it in append mode will fail.
 
749
        state.unlock()
747
750
        f = open('dirstate', 'ab')
748
751
        try:
749
752
            # Add bogus trailing garbage
750
753
            f.write('bogus\n')
751
754
        finally:
752
755
            f.close()
 
756
            state.lock_read()
753
757
        e = self.assertRaises(errors.DirstateCorrupt,
754
758
                              state._read_dirblocks_if_needed)
755
759
        # Make sure we mention the bogus characters in the error