~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Martin Pool
  • Date: 2007-03-25 08:15:59 UTC
  • mto: (2323.5.3 0.15)
  • mto: This revision was merged to the branch mainline in revision 2390.
  • Revision ID: mbp@sourcefrog.net-20070325081559-uhe1bo23m9kqltm3
Fix some tests that need to lock dirstate before validating

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
             ])])
207
207
        state = dirstate.DirState.from_tree(tree, 'dirstate')
208
208
        self.check_state_with_reopen(expected_result, state)
209
 
        state._validate()
 
209
        state.lock_read()
 
210
        try:
 
211
            state._validate()
 
212
        finally:
 
213
            state.unlock()
210
214
 
211
215
    def test_2_parents_empty_to_dirstate(self):
212
216
        # create a parent by doing a commit
223
227
             ])])
224
228
        state = dirstate.DirState.from_tree(tree, 'dirstate')
225
229
        self.check_state_with_reopen(expected_result, state)
226
 
        state._validate()
 
230
        state.lock_read()
 
231
        try:
 
232
            state._validate()
 
233
        finally:
 
234
            state.unlock()
227
235
 
228
236
    def test_empty_unknowns_are_ignored_to_dirstate(self):
229
237
        """We should be able to create a dirstate for an empty tree."""
533
541
        finally:
534
542
            state.unlock()
535
543
        state = dirstate.DirState.on_file('dirstate')
536
 
        state._validate()
537
544
        state.lock_read()
538
545
        try:
 
546
            state._validate()
539
547
            self.assertEqual(expected_rows, list(state._iter_entries()))
540
548
        finally:
541
549
            state.unlock()