262
262
_test_needs_features = [CompiledDirstateHelpersFeature]
264
264
def get_bisect_path(self):
265
from bzrlib._dirstate_helpers_pyx import _bisect_path_left_c
266
return _bisect_path_left_c
265
from bzrlib._dirstate_helpers_pyx import _bisect_path_left
266
return _bisect_path_left
269
269
class TestBisectPathRight(tests.TestCase, TestBisectPathMixin):
270
270
"""Run all Bisect Path tests against _bisect_path_right_py"""
272
272
def get_bisect_path(self):
273
from bzrlib._dirstate_helpers_py import _bisect_path_right_py
274
return _bisect_path_right_py
273
from bzrlib._dirstate_helpers_py import _bisect_path_right
274
return _bisect_path_right
276
276
def get_bisect(self):
277
277
return bisect.bisect_right, -1
777
777
def test_bisect_dirblock(self):
778
778
if CompiledDirstateHelpersFeature.available():
779
from bzrlib._dirstate_helpers_pyx import bisect_dirblock_c
780
self.assertIs(bisect_dirblock_c, dirstate.bisect_dirblock)
779
from bzrlib._dirstate_helpers_pyx import bisect_dirblock
782
from bzrlib._dirstate_helpers_py import bisect_dirblock_py
783
self.assertIs(bisect_dirblock_py, dirstate.bisect_dirblock)
781
from bzrlib._dirstate_helpers_py import bisect_dirblock
782
self.assertIs(bisect_dirblock, dirstate.bisect_dirblock)
785
784
def test__bisect_path_left(self):
786
785
if CompiledDirstateHelpersFeature.available():
787
from bzrlib._dirstate_helpers_pyx import _bisect_path_left_c
788
self.assertIs(_bisect_path_left_c, dirstate._bisect_path_left)
786
from bzrlib._dirstate_helpers_pyx import _bisect_path_left
790
from bzrlib._dirstate_helpers_py import _bisect_path_left_py
791
self.assertIs(_bisect_path_left_py, dirstate._bisect_path_left)
788
from bzrlib._dirstate_helpers_py import _bisect_path_left
789
self.assertIs(_bisect_path_left, dirstate._bisect_path_left)
793
791
def test__bisect_path_right(self):
794
792
if CompiledDirstateHelpersFeature.available():
795
from bzrlib._dirstate_helpers_pyx import _bisect_path_right_c
796
self.assertIs(_bisect_path_right_c, dirstate._bisect_path_right)
793
from bzrlib._dirstate_helpers_pyx import _bisect_path_right
798
from bzrlib._dirstate_helpers_py import _bisect_path_right_py
799
self.assertIs(_bisect_path_right_py, dirstate._bisect_path_right)
795
from bzrlib._dirstate_helpers_py import _bisect_path_right
796
self.assertIs(_bisect_path_right, dirstate._bisect_path_right)
801
798
def test_cmp_by_dirs(self):
802
799
if CompiledDirstateHelpersFeature.available():
803
from bzrlib._dirstate_helpers_pyx import cmp_by_dirs_c
804
self.assertIs(cmp_by_dirs_c, dirstate.cmp_by_dirs)
800
from bzrlib._dirstate_helpers_pyx import cmp_by_dirs
806
from bzrlib._dirstate_helpers_py import cmp_by_dirs_py
807
self.assertIs(cmp_by_dirs_py, dirstate.cmp_by_dirs)
802
from bzrlib._dirstate_helpers_py import cmp_by_dirs
803
self.assertIs(cmp_by_dirs, dirstate.cmp_by_dirs)
809
805
def test__read_dirblocks(self):
810
806
if CompiledDirstateHelpersFeature.available():
811
from bzrlib._dirstate_helpers_pyx import _read_dirblocks_c
812
self.assertIs(_read_dirblocks_c, dirstate._read_dirblocks)
807
from bzrlib._dirstate_helpers_pyx import _read_dirblocks
814
from bzrlib._dirstate_helpers_py import _read_dirblocks_py
815
self.assertIs(_read_dirblocks_py, dirstate._read_dirblocks)
809
from bzrlib._dirstate_helpers_py import _read_dirblocks
810
self.assertIs(_read_dirblocks, dirstate._read_dirblocks)
817
812
def test_update_entry(self):
818
813
if CompiledDirstateHelpersFeature.available():
819
814
from bzrlib._dirstate_helpers_pyx import update_entry
820
self.assertIs(update_entry, dirstate.update_entry)
822
from bzrlib.dirstate import py_update_entry
823
self.assertIs(py_update_entry, dirstate.py_update_entry)
816
from bzrlib.dirstate import update_entry
817
self.assertIs(update_entry, dirstate.update_entry)
825
819
def test_process_entry(self):
826
820
if CompiledDirstateHelpersFeature.available():