/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_identitymap.py

  • Committer: Martin
  • Date: 2018-08-21 00:53:34 UTC
  • mto: This revision was merged to the branch mainline in revision 7074.
  • Revision ID: gzlist@googlemail.com-20180821005334-e1ogxakojyybpwib
Fix recursion check in C bencode implementation

Hard to get Cython to do the right thing but by inverting the
return code can use the standard except handling.

Avoid going through a Python call when encoding, which requires
the encode recursion check to work too.

Adjust tests to use a smaller limit to be more managable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
# import system imports here
21
21
 
22
 
#import bzrlib specific imports here
23
 
import bzrlib.errors as errors
24
 
from bzrlib.tests import TestCase
25
 
import bzrlib.identitymap as identitymap
 
22
#import breezy specific imports here
 
23
from .. import errors as errors
 
24
from . import TestCase
 
25
from .. import identitymap as identitymap
26
26
 
27
27
 
28
28
class TestIdentityMap(TestCase):
29
29
 
30
30
    def test_symbols(self):
31
 
        from bzrlib.identitymap import IdentityMap
 
31
        from ..identitymap import IdentityMap
32
32
 
33
33
    def test_construct(self):
34
34
        identitymap.IdentityMap()
57
57
class TestNullIdentityMap(TestCase):
58
58
 
59
59
    def test_symbols(self):
60
 
        from bzrlib.identitymap import NullIdentityMap
 
60
        from ..identitymap import NullIdentityMap
61
61
 
62
62
    def test_construct(self):
63
63
        identitymap.NullIdentityMap()