~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inventory_delta.py

  • Committer: John Arbash Meinel
  • Date: 2010-08-23 17:54:07 UTC
  • mfrom: (5387 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5390.
  • Revision ID: john@arbash-meinel.com-20100823175407-yomx2h1x5v8amt6w
Merge bzr.dev 5387 in prep for NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
387
387
        root = new_inv.make_entry('directory', '', None, 'my-rich-root-id')
388
388
        root.revision = 'changed'
389
389
        new_inv.add(root)
390
 
        non_root = new_inv.make_entry('directory', 'foo', root.file_id, 'id')
 
390
        class StrangeInventoryEntry(inventory.InventoryEntry):
 
391
            kind = 'strange'
 
392
        non_root = StrangeInventoryEntry('id', 'foo', root.file_id)
391
393
        non_root.revision = 'changed'
392
 
        non_root.kind = 'strangelove'
393
394
        new_inv.add(non_root)
394
395
        delta = new_inv._make_delta(old_inv)
395
396
        serializer = inventory_delta.InventoryDeltaSerializer(
398
399
        # This test aims to prove that it errors more than how it errors.
399
400
        err = self.assertRaises(KeyError,
400
401
            serializer.delta_to_lines, NULL_REVISION, 'entry-version', delta)
401
 
        self.assertEqual(('strangelove',), err.args)
 
402
        self.assertEqual(('strange',), err.args)
402
403
 
403
404
    def test_tree_reference_disabled(self):
404
405
        old_inv = Inventory(None)