~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_counted_lock.py

  • Committer: John Arbash Meinel
  • Date: 2012-09-19 07:58:27 UTC
  • mfrom: (6437.63.9 2.5)
  • mto: This revision was merged to the branch mainline in revision 6563.
  • Revision ID: john@arbash-meinel.com-20120919075827-36b2b042kiaps0d3
Merge bzr-2.5.2 into trunk to get the fixes for ConnectionReset.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2008, 2009, 2016 Canonical Ltd
 
1
# Copyright (C) 2007, 2008, 2009 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
143
143
        self.assertTrue(l.is_locked())
144
144
        l.unlock()
145
145
        self.assertFalse(l.is_locked())
146
 
        self.assertEqual(
 
146
        self.assertEquals(
147
147
            ['lock_read', 'unlock'],
148
148
            real_lock._calls)
149
149
 
157
157
        l = CountedLock(real_lock)
158
158
        l.lock_write()
159
159
        l.lock_read()
160
 
        self.assertEqual('token', l.lock_write())
 
160
        self.assertEquals('token', l.lock_write())
161
161
        l.unlock()
162
162
        l.unlock()
163
163
        l.unlock()
164
164
        self.assertFalse(l.is_locked())
165
 
        self.assertEqual(
 
165
        self.assertEquals(
166
166
            ['lock_write', 'unlock'],
167
167
            real_lock._calls)
168
168
 
174
174
        self.assertRaises(ReadOnlyError, l.lock_write)
175
175
        l.unlock()
176
176
        self.assertFalse(l.is_locked())
177
 
        self.assertEqual(
 
177
        self.assertEquals(
178
178
            ['lock_read', 'unlock'],
179
179
            real_lock._calls)
180
180