/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 breezy/tests/test_transactions.py

  • Committer: Jelmer Vernooij
  • Date: 2020-03-22 01:35:14 UTC
  • mfrom: (7490.7.6 work)
  • mto: This revision was merged to the branch mainline in revision 7499.
  • Revision ID: jelmer@jelmer.uk-20200322013514-7vw1ntwho04rcuj3
merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Tests for the behaviour of the Transaction concept in bzr."""
19
19
 
20
 
#import breezy specific imports here
 
20
# import breezy specific imports here
21
21
import breezy.errors as errors
22
22
from breezy.tests import TestCase
23
23
import breezy.transactions as transactions
35
35
            return False
36
36
        return self._message == other._message
37
37
 
 
38
    def __hash__(self):
 
39
        return hash((type(self), self._message))
 
40
 
38
41
    def transaction_finished(self):
39
42
        self.finished = True
40
43
 
42
45
class TestSymbols(TestCase):
43
46
 
44
47
    def test_public_symbols(self):
45
 
        from breezy.transactions import ReadOnlyTransaction
46
 
        from breezy.transactions import PassThroughTransaction
 
48
        from breezy.transactions import ReadOnlyTransaction  # noqa: F401
 
49
        from breezy.transactions import PassThroughTransaction  # noqa: F401
47
50
 
48
51
 
49
52
class TestReadOnlyTransaction(TestCase):
99
102
    def test_small_cache(self):
100
103
        self.transaction.set_cache_size(1)
101
104
        # add an object, should not fall right out if there are no references
102
 
        #sys.getrefcounts(foo)
 
105
        # sys.getrefcounts(foo)
103
106
        self.transaction.map.add_weave("id", DummyWeave("a weave"))
104
107
        self.transaction.register_clean(self.transaction.map.find_weave("id"))
105
108
        self.assertEqual(DummyWeave("a weave"),
259
262
    def test_small_cache(self):
260
263
        self.transaction.set_cache_size(1)
261
264
        # add an object, should not fall right out if there are no references
262
 
        #sys.getrefcounts(foo)
 
265
        # sys.getrefcounts(foo)
263
266
        self.transaction.map.add_weave("id", DummyWeave("a weave"))
264
267
        self.transaction.register_clean(self.transaction.map.find_weave("id"))
265
268
        self.assertEqual(DummyWeave("a weave"),