~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testidentitymap.py

  • Committer: Robert Collins
  • Date: 2005-10-09 23:52:04 UTC
  • Revision ID: robertc@robertcollins.net-20051009235204-0abf18346c658e34
touchup the prefixed-store patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005 by Canonical Ltd
2
2
#   Authors: Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
13
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
"""Tests for the IdentityMap class."""
19
19
 
21
21
 
22
22
#import bzrlib specific imports here
23
23
import bzrlib.errors as errors
24
 
from bzrlib.tests import TestCase
 
24
from bzrlib.selftest import TestCase
25
25
import bzrlib.identitymap as identitymap
26
26
 
27
27
 
45
45
        map.add_weave("id", weave)
46
46
        self.assertRaises(errors.BzrError, map.add_weave, "id", weave)
47
47
        self.assertEqual(weave, map.find_weave("id"))
48
 
 
49
 
    def test_remove_object(self):
50
 
        map = identitymap.IdentityMap()
51
 
        weave = "foo"
52
 
        map.add_weave("id", weave)
53
 
        map.remove_object(weave)
54
 
        map.add_weave("id", weave)
55
 
 
56
 
 
 
48
 
 
49
 
57
50
class TestNullIdentityMap(TestCase):
58
51
 
59
52
    def test_symbols(self):
74
67
        map.add_weave("id", weave)
75
68
        map.add_weave("id", weave)
76
69
        self.assertEqual(None, map.find_weave("id"))
77
 
 
78
 
    def test_null_identity_map_has_no_remove(self):
79
 
        map = identitymap.NullIdentityMap()
80
 
        self.assertEqual(None, getattr(map, 'remove_object', None))
81
 
 
 
70