/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test__bencode.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import sys
20
20
 
21
 
from bzrlib import tests
 
21
from .. import tests
22
22
 
23
 
def load_tests(standard_tests, module, loader):
 
23
def load_tests(loader, standard_tests, pattern):
24
24
    suite, _ = tests.permute_tests_for_extension(standard_tests, loader,
25
 
        'bzrlib.util._bencode_py', 'bzrlib._bencode_pyx')
 
25
        'breezy.util._bencode_py', 'breezy._bencode_pyx')
26
26
    return suite
27
27
 
28
28
 
45
45
        self._check(int('1' * 1000), 'i' + ('1' * 1000) + 'e')
46
46
 
47
47
    def test_long(self):
48
 
        self._check(12345678901234567890L, 'i12345678901234567890e')
49
 
        self._check(-12345678901234567890L, 'i-12345678901234567890e')
 
48
        self._check(12345678901234567890, 'i12345678901234567890e')
 
49
        self._check(-12345678901234567890, 'i-12345678901234567890e')
50
50
 
51
51
    def test_malformed_int(self):
52
52
        self._run_check_error(ValueError, 'ie')
163
163
        self._check('i-10e', -10)
164
164
 
165
165
    def test_long(self):
166
 
        self._check('i12345678901234567890e', 12345678901234567890L)
167
 
        self._check('i-12345678901234567890e', -12345678901234567890L)
 
166
        self._check('i12345678901234567890e', 12345678901234567890)
 
167
        self._check('i-12345678901234567890e', -12345678901234567890)
168
168
 
169
169
    def test_string(self):
170
170
        self._check('0:', '')