~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_knit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-22 18:18:20 UTC
  • mfrom: (4913.2.26 2.1.0rc1-module-available)
  • Revision ID: pqm@pqm.ubuntu.com-20091222181820-qfolh2sy2nevoxxj
(jam) Switch many test features over to ModuleAvailable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    multiparent,
29
29
    osutils,
30
30
    pack,
 
31
    tests,
31
32
    )
32
33
from bzrlib.errors import (
33
34
    RevisionAlreadyPresent,
69
70
    )
70
71
 
71
72
 
72
 
class _CompiledKnitFeature(Feature):
73
 
 
74
 
    def _probe(self):
75
 
        try:
76
 
            import bzrlib._knit_load_data_pyx
77
 
        except ImportError:
78
 
            return False
79
 
        return True
80
 
 
81
 
    def feature_name(self):
82
 
        return 'bzrlib._knit_load_data_pyx'
83
 
 
84
 
CompiledKnitFeature = _CompiledKnitFeature()
 
73
compiled_knit_feature = tests.ModuleAvailableFeature(
 
74
                            'bzrlib._knit_load_data_pyx')
85
75
 
86
76
 
87
77
class KnitContentTestsMixin(object):
1308
1298
 
1309
1299
class LowLevelKnitIndexTests_c(LowLevelKnitIndexTests):
1310
1300
 
1311
 
    _test_needs_features = [CompiledKnitFeature]
 
1301
    _test_needs_features = [compiled_knit_feature]
1312
1302
 
1313
1303
    def get_knit_index(self, transport, name, mode):
1314
1304
        mapper = ConstantMapper(name)