~ubuntu-branches/ubuntu/natty/bzr/natty

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-10-11 02:21:33 UTC
  • mfrom: (1.4.9 upstream) (9.2.5 experimental)
  • Revision ID: james.westby@ubuntu.com-20101011022133-smjfrb0gdlrgpra2
Tags: 2.3.0~beta2-1
* New upstream release.
* Rebuild with python2.5 modules. Closes: #593409

Show diffs side-by-side

added added

removed removed

Lines of Context:
730
730
 
731
731
class TestDirStateManipulations(TestCaseWithDirState):
732
732
 
 
733
    def test_update_minimal_updates_id_index(self):
 
734
        state = self.create_dirstate_with_root_and_subdir()
 
735
        self.addCleanup(state.unlock)
 
736
        id_index = state._get_id_index()
 
737
        self.assertEqual(['a-root-value', 'subdir-id'], sorted(id_index))
 
738
        state.add('file-name', 'file-id', 'file', None, '')
 
739
        self.assertEqual(['a-root-value', 'file-id', 'subdir-id'],
 
740
                         sorted(id_index))
 
741
        state.update_minimal(('', 'new-name', 'file-id'), 'f',
 
742
                             path_utf8='new-name')
 
743
        self.assertEqual(['a-root-value', 'file-id', 'subdir-id'],
 
744
                         sorted(id_index))
 
745
        self.assertEqual([('', 'new-name', 'file-id')],
 
746
                         sorted(id_index['file-id']))
 
747
        state._validate()
 
748
 
733
749
    def test_set_state_from_inventory_no_content_no_parents(self):
734
750
        # setting the current inventory is a slow but important api to support.
735
751
        tree1 = self.make_branch_and_memory_tree('tree1')