~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree_4.py

  • Committer: Martin Pool
  • Date: 2007-03-05 03:55:31 UTC
  • mto: (2255.2.180 subtree)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: mbp@sourcefrog.net-20070305035531-1t1wn6oy526vrb0q
Tree.id2path should raise NoSuchId, not return None.

Add tree implementation test for this and update WorkingTree_4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
422
422
        self.build_tree(['tree/a', 'tree/b'])
423
423
        tree.add(['a'], ['a-id'])
424
424
        self.assertEqual(u'a', tree.id2path('a-id'))
425
 
        self.assertIs(None, tree.id2path('a'))
 
425
        self.assertRaises(errors.NoSuchId, tree.id2path, 'a')
426
426
        tree.commit('a')
427
427
        tree.add(['b'], ['b-id'])
428
428
 
430
430
        self.assertEqual(u'b\xb5rry', tree.id2path('a-id'))
431
431
        tree.commit(u'b\xb5rry')
432
432
        tree.unversion(['a-id'])
433
 
        self.assertEqual(None, tree.id2path('a-id'))
 
433
        self.assertRaises(errors.NoSuchId, tree.id2path, 'a-id')
434
434
        self.assertEqual('b', tree.id2path('b-id'))
435
 
        self.assertEqual(None, tree.id2path('c-id'))
 
435
        self.assertRaises(errors.NoSuchId, tree.id2path, 'c-id')
436
436
 
437
437
    def test_set_root_id(self):
438
438
        # similar to some code that fails in the dirstate-plus-subtree branch