~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__dirstate_helpers.py

Change all of the compiled_foo to compiled_foo_feature

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    has_dirstate_helpers_pyx = False
39
39
 
40
40
 
41
 
compiled_dirstate_helpers = tests.ModuleAvailableFeature(
 
41
compiled_dirstate_helpers_feature = tests.ModuleAvailableFeature(
42
42
                                'bzrlib._dirstate_helpers_pyx')
43
43
 
44
44
 
51
51
 
52
52
    ue_scenarios = [('dirstate_Python',
53
53
                     {'update_entry': dirstate.py_update_entry})]
54
 
    if compiled_dirstate_helpers.available():
55
 
        update_entry = compiled_dirstate_helpers.module.update_entry
 
54
    if compiled_dirstate_helpers_feature.available():
 
55
        update_entry = compiled_dirstate_helpers_feature.module.update_entry
56
56
        pyrex_scenario = ('dirstate_Pyrex', {'update_entry': update_entry})
57
57
        ue_scenarios.append(pyrex_scenario)
58
58
    process_entry_tests, remaining_tests = tests.split_suite_by_condition(
64
64
 
65
65
    pe_scenarios = [('dirstate_Python',
66
66
                     {'_process_entry': dirstate.ProcessEntryPython})]
67
 
    if compiled_dirstate_helpers.available():
68
 
        process_entry = compiled_dirstate_helpers.module.ProcessEntryC
 
67
    if compiled_dirstate_helpers_feature.available():
 
68
        process_entry = compiled_dirstate_helpers_feature.module.ProcessEntryC
69
69
        pyrex_scenario = ('dirstate_Pyrex', {'_process_entry': process_entry})
70
70
        pe_scenarios.append(pyrex_scenario)
71
71
    process_entry_tests, remaining_tests = tests.split_suite_by_condition(
253
253
class TestCompiledBisectPathLeft(TestBisectPathLeft):
254
254
    """Run all Bisect Path tests against _bisect_path_lect"""
255
255
 
256
 
    _test_needs_features = [compiled_dirstate_helpers]
 
256
    _test_needs_features = [compiled_dirstate_helpers_feature]
257
257
 
258
258
    def get_bisect_path(self):
259
259
        from bzrlib._dirstate_helpers_pyx import _bisect_path_left
274
274
class TestCompiledBisectPathRight(TestBisectPathRight):
275
275
    """Run all Bisect Path tests against _bisect_path_right"""
276
276
 
277
 
    _test_needs_features = [compiled_dirstate_helpers]
 
277
    _test_needs_features = [compiled_dirstate_helpers_feature]
278
278
 
279
279
    def get_bisect_path(self):
280
280
        from bzrlib._dirstate_helpers_pyx import _bisect_path_right
386
386
    compiled version.
387
387
    """
388
388
 
389
 
    _test_needs_features = [compiled_dirstate_helpers]
 
389
    _test_needs_features = [compiled_dirstate_helpers_feature]
390
390
 
391
391
    def get_bisect_dirblock(self):
392
392
        from bzrlib._dirstate_helpers_pyx import bisect_dirblock
508
508
class TestCompiledCmpByDirs(TestCmpByDirs):
509
509
    """Test the pyrex implementation of cmp_by_dirs"""
510
510
 
511
 
    _test_needs_features = [compiled_dirstate_helpers]
 
511
    _test_needs_features = [compiled_dirstate_helpers_feature]
512
512
 
513
513
    def get_cmp_by_dirs(self):
514
514
        from bzrlib._dirstate_helpers_pyx import cmp_by_dirs
659
659
class TestCompiledCmpPathByDirblock(TestCmpPathByDirblock):
660
660
    """Test the pyrex implementation of _cmp_path_by_dirblock"""
661
661
 
662
 
    _test_needs_features = [compiled_dirstate_helpers]
 
662
    _test_needs_features = [compiled_dirstate_helpers_feature]
663
663
 
664
664
    def get_cmp_by_dirs(self):
665
665
        from bzrlib._dirstate_helpers_pyx import _cmp_path_by_dirblock
669
669
class TestMemRChr(tests.TestCase):
670
670
    """Test memrchr functionality"""
671
671
 
672
 
    _test_needs_features = [compiled_dirstate_helpers]
 
672
    _test_needs_features = [compiled_dirstate_helpers_feature]
673
673
 
674
674
    def assertMemRChr(self, expected, s, c):
675
675
        from bzrlib._dirstate_helpers_pyx import _py_memrchr
757
757
class TestCompiledReadDirblocks(TestReadDirblocks):
758
758
    """Test the pyrex implementation of _read_dirblocks"""
759
759
 
760
 
    _test_needs_features = [compiled_dirstate_helpers]
 
760
    _test_needs_features = [compiled_dirstate_helpers_feature]
761
761
 
762
762
    def get_read_dirblocks(self):
763
763
        from bzrlib._dirstate_helpers_pyx import _read_dirblocks
773
773
    """
774
774
 
775
775
    def test_bisect_dirblock(self):
776
 
        if compiled_dirstate_helpers.available():
 
776
        if compiled_dirstate_helpers_feature.available():
777
777
            from bzrlib._dirstate_helpers_pyx import bisect_dirblock
778
778
        else:
779
779
            from bzrlib._dirstate_helpers_py import bisect_dirblock
780
780
        self.assertIs(bisect_dirblock, dirstate.bisect_dirblock)
781
781
 
782
782
    def test__bisect_path_left(self):
783
 
        if compiled_dirstate_helpers.available():
 
783
        if compiled_dirstate_helpers_feature.available():
784
784
            from bzrlib._dirstate_helpers_pyx import _bisect_path_left
785
785
        else:
786
786
            from bzrlib._dirstate_helpers_py import _bisect_path_left
787
787
        self.assertIs(_bisect_path_left, dirstate._bisect_path_left)
788
788
 
789
789
    def test__bisect_path_right(self):
790
 
        if compiled_dirstate_helpers.available():
 
790
        if compiled_dirstate_helpers_feature.available():
791
791
            from bzrlib._dirstate_helpers_pyx import _bisect_path_right
792
792
        else:
793
793
            from bzrlib._dirstate_helpers_py import _bisect_path_right
794
794
        self.assertIs(_bisect_path_right, dirstate._bisect_path_right)
795
795
 
796
796
    def test_cmp_by_dirs(self):
797
 
        if compiled_dirstate_helpers.available():
 
797
        if compiled_dirstate_helpers_feature.available():
798
798
            from bzrlib._dirstate_helpers_pyx import cmp_by_dirs
799
799
        else:
800
800
            from bzrlib._dirstate_helpers_py import cmp_by_dirs
801
801
        self.assertIs(cmp_by_dirs, dirstate.cmp_by_dirs)
802
802
 
803
803
    def test__read_dirblocks(self):
804
 
        if compiled_dirstate_helpers.available():
 
804
        if compiled_dirstate_helpers_feature.available():
805
805
            from bzrlib._dirstate_helpers_pyx import _read_dirblocks
806
806
        else:
807
807
            from bzrlib._dirstate_helpers_py import _read_dirblocks
808
808
        self.assertIs(_read_dirblocks, dirstate._read_dirblocks)
809
809
 
810
810
    def test_update_entry(self):
811
 
        if compiled_dirstate_helpers.available():
 
811
        if compiled_dirstate_helpers_feature.available():
812
812
            from bzrlib._dirstate_helpers_pyx import update_entry
813
813
        else:
814
814
            from bzrlib.dirstate import update_entry
815
815
        self.assertIs(update_entry, dirstate.update_entry)
816
816
 
817
817
    def test_process_entry(self):
818
 
        if compiled_dirstate_helpers.available():
 
818
        if compiled_dirstate_helpers_feature.available():
819
819
            from bzrlib._dirstate_helpers_pyx import ProcessEntryC
820
820
            self.assertIs(ProcessEntryC, dirstate._process_entry)
821
821
        else: