/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inventory_delta.py

  • Committer: Martin Pool
  • Date: 2010-10-08 04:38:25 UTC
  • mfrom: (5462 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5478.
  • Revision ID: mbp@sourcefrog.net-20101008043825-b181r8bo5r3qwb6j
merge trunk

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)