~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bencode.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-03 14:14:31 UTC
  • mto: This revision was merged to the branch mainline in revision 4410.
  • Revision ID: john@arbash-meinel.com-20090603141431-zeurvzs2iezwzdn5
A bit of code restructuring.
Move bzrlib/_bencode_py.py back to bzrlib/util/_bencode_py.py
Leaving it as _bencode_py.py so that people don't accidentally
import the old version.
Renaming _bencode_c.pyx => _bencode_pyx.pyx to conform to new naming scheme.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
def load_tests(standard_tests, module, loader):
22
22
    # parameterize all tests in this module
23
23
    suite = loader.suiteClass()
24
 
    import bzrlib._bencode_py as py_module
 
24
    import bzrlib.util._bencode_py as py_module
25
25
    scenarios = [('python', {'bencode': py_module})]
26
26
    if CompiledBencodeFeature.available():
27
 
        import bzrlib._bencode_c as c_module
 
27
        import bzrlib._bencode_pyx as c_module
28
28
        scenarios.append(('C', {'bencode': c_module}))
29
29
    else:
30
30
        # the compiled module isn't available, so we add a failing test
40
40
 
41
41
    def _probe(self):
42
42
        try:
43
 
            import bzrlib._bencode_c
 
43
            import bzrlib._bencode_pyx
44
44
        except ImportError:
45
45
            return False
46
46
        return True
47
47
 
48
48
    def feature_name(self):
49
 
        return 'bzrlib._bencode_c'
 
49
        return 'bzrlib._bencode_pyx'
50
50
 
51
51
CompiledBencodeFeature = _CompiledBencodeFeature()
52
52