/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test__dirstate_helpers.py

  • Committer: Jelmer Vernooij
  • Date: 2020-05-24 00:39:50 UTC
  • mto: This revision was merged to the branch mainline in revision 7504.
  • Revision ID: jelmer@jelmer.uk-20200524003950-bbc545r76vc5yajg
Add github action.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
import time
22
22
 
23
 
from ... import (
 
23
from .. import (
24
24
    osutils,
25
25
    tests,
26
26
    )
27
 
from .. import (
 
27
from ..bzr import (
28
28
    dirstate,
29
29
    _dirstate_helpers_py,
30
30
    )
31
31
from . import (
32
32
    test_dirstate,
33
33
    )
34
 
from ...tests.test_osutils import dir_reader_scenarios
35
 
from ...tests.scenarios import (
 
34
from .test_osutils import dir_reader_scenarios
 
35
from .scenarios import (
36
36
    load_tests_apply_scenarios,
37
37
    multiply_scenarios,
38
38
    )
39
 
from ...tests import (
 
39
from . import (
40
40
    features,
41
41
    )
42
42
 
227
227
    """Run all Bisect Path tests against _bisect_path_left."""
228
228
 
229
229
    def get_bisect_path(self):
230
 
        from .._dirstate_helpers_py import _bisect_path_left
 
230
        from breezy.bzr._dirstate_helpers_py import _bisect_path_left
231
231
        return _bisect_path_left
232
232
 
233
233
    def get_bisect(self):
240
240
    _test_needs_features = [compiled_dirstate_helpers_feature]
241
241
 
242
242
    def get_bisect_path(self):
243
 
        from .._dirstate_helpers_pyx import _bisect_path_left
 
243
        from breezy.bzr._dirstate_helpers_pyx import _bisect_path_left
244
244
        return _bisect_path_left
245
245
 
246
246
 
248
248
    """Run all Bisect Path tests against _bisect_path_right"""
249
249
 
250
250
    def get_bisect_path(self):
251
 
        from .._dirstate_helpers_py import _bisect_path_right
 
251
        from breezy.bzr._dirstate_helpers_py import _bisect_path_right
252
252
        return _bisect_path_right
253
253
 
254
254
    def get_bisect(self):
261
261
    _test_needs_features = [compiled_dirstate_helpers_feature]
262
262
 
263
263
    def get_bisect_path(self):
264
 
        from .._dirstate_helpers_pyx import _bisect_path_right
 
264
        from breezy.bzr._dirstate_helpers_pyx import _bisect_path_right
265
265
        return _bisect_path_right
266
266
 
267
267
 
279
279
 
280
280
    def get_bisect_dirblock(self):
281
281
        """Return an implementation of bisect_dirblock"""
282
 
        from .._dirstate_helpers_py import bisect_dirblock
 
282
        from breezy.bzr._dirstate_helpers_py import bisect_dirblock
283
283
        return bisect_dirblock
284
284
 
285
285
    def assertBisect(self, dirblocks, split_dirblocks, path, *args, **kwargs):
373
373
    _test_needs_features = [compiled_dirstate_helpers_feature]
374
374
 
375
375
    def get_bisect_dirblock(self):
376
 
        from .._dirstate_helpers_pyx import bisect_dirblock
 
376
        from breezy.bzr._dirstate_helpers_pyx import bisect_dirblock
377
377
        return bisect_dirblock
378
378
 
379
379
 
389
389
 
390
390
    def get_lt_by_dirs(self):
391
391
        """Get a specific implementation of lt_by_dirs."""
392
 
        from .._dirstate_helpers_py import lt_by_dirs
 
392
        from ..bzr._dirstate_helpers_py import lt_by_dirs
393
393
        return lt_by_dirs
394
394
 
395
395
    def assertCmpByDirs(self, expected, str1, str2):
496
496
    _test_needs_features = [compiled_dirstate_helpers_feature]
497
497
 
498
498
    def get_lt_by_dirs(self):
499
 
        from .._dirstate_helpers_pyx import lt_by_dirs
 
499
        from ..bzr._dirstate_helpers_pyx import lt_by_dirs
500
500
        return lt_by_dirs
501
501
 
502
502
 
512
512
 
513
513
    def get_lt_path_by_dirblock(self):
514
514
        """Get a specific implementation of _lt_path_by_dirblock."""
515
 
        from .._dirstate_helpers_py import _lt_path_by_dirblock
 
515
        from ..bzr._dirstate_helpers_py import _lt_path_by_dirblock
516
516
        return _lt_path_by_dirblock
517
517
 
518
518
    def assertLtPathByDirblock(self, paths):
637
637
    _test_needs_features = [compiled_dirstate_helpers_feature]
638
638
 
639
639
    def get_lt_path_by_dirblock(self):
640
 
        from .._dirstate_helpers_pyx import _lt_path_by_dirblock
 
640
        from ..bzr._dirstate_helpers_pyx import _lt_path_by_dirblock
641
641
        return _lt_path_by_dirblock
642
642
 
643
643
 
647
647
    _test_needs_features = [compiled_dirstate_helpers_feature]
648
648
 
649
649
    def assertMemRChr(self, expected, s, c):
650
 
        from .._dirstate_helpers_pyx import _py_memrchr
 
650
        from breezy.bzr._dirstate_helpers_pyx import _py_memrchr
651
651
        self.assertEqual(expected, _py_memrchr(s, c))
652
652
 
653
653
    def test_missing(self):
697
697
    # inherits scenarios from test_dirstate
698
698
 
699
699
    def get_read_dirblocks(self):
700
 
        from .._dirstate_helpers_py import _read_dirblocks
 
700
        from breezy.bzr._dirstate_helpers_py import _read_dirblocks
701
701
        return _read_dirblocks
702
702
 
703
703
    def test_smoketest(self):
737
737
    _test_needs_features = [compiled_dirstate_helpers_feature]
738
738
 
739
739
    def get_read_dirblocks(self):
740
 
        from .._dirstate_helpers_pyx import _read_dirblocks
 
740
        from breezy.bzr._dirstate_helpers_pyx import _read_dirblocks
741
741
        return _read_dirblocks
742
742
 
743
743
 
751
751
 
752
752
    def test_bisect_dirblock(self):
753
753
        if compiled_dirstate_helpers_feature.available():
754
 
            from .._dirstate_helpers_pyx import bisect_dirblock
 
754
            from breezy.bzr._dirstate_helpers_pyx import bisect_dirblock
755
755
        else:
756
 
            from .._dirstate_helpers_py import bisect_dirblock
 
756
            from breezy.bzr._dirstate_helpers_py import bisect_dirblock
757
757
        self.assertIs(bisect_dirblock, dirstate.bisect_dirblock)
758
758
 
759
759
    def test__bisect_path_left(self):
760
760
        if compiled_dirstate_helpers_feature.available():
761
 
            from .._dirstate_helpers_pyx import _bisect_path_left
 
761
            from breezy.bzr._dirstate_helpers_pyx import _bisect_path_left
762
762
        else:
763
 
            from .._dirstate_helpers_py import _bisect_path_left
 
763
            from breezy.bzr._dirstate_helpers_py import _bisect_path_left
764
764
        self.assertIs(_bisect_path_left, dirstate._bisect_path_left)
765
765
 
766
766
    def test__bisect_path_right(self):
767
767
        if compiled_dirstate_helpers_feature.available():
768
 
            from .._dirstate_helpers_pyx import _bisect_path_right
 
768
            from breezy.bzr._dirstate_helpers_pyx import _bisect_path_right
769
769
        else:
770
 
            from .._dirstate_helpers_py import _bisect_path_right
 
770
            from breezy.bzr._dirstate_helpers_py import _bisect_path_right
771
771
        self.assertIs(_bisect_path_right, dirstate._bisect_path_right)
772
772
 
773
773
    def test_lt_by_dirs(self):
774
774
        if compiled_dirstate_helpers_feature.available():
775
 
            from .._dirstate_helpers_pyx import lt_by_dirs
 
775
            from ..bzr._dirstate_helpers_pyx import lt_by_dirs
776
776
        else:
777
 
            from .._dirstate_helpers_py import lt_by_dirs
 
777
            from ..bzr._dirstate_helpers_py import lt_by_dirs
778
778
        self.assertIs(lt_by_dirs, dirstate.lt_by_dirs)
779
779
 
780
780
    def test__read_dirblocks(self):
781
781
        if compiled_dirstate_helpers_feature.available():
782
 
            from .._dirstate_helpers_pyx import _read_dirblocks
 
782
            from breezy.bzr._dirstate_helpers_pyx import _read_dirblocks
783
783
        else:
784
 
            from .._dirstate_helpers_py import _read_dirblocks
 
784
            from breezy.bzr._dirstate_helpers_py import _read_dirblocks
785
785
        self.assertIs(_read_dirblocks, dirstate._read_dirblocks)
786
786
 
787
787
    def test_update_entry(self):
788
788
        if compiled_dirstate_helpers_feature.available():
789
 
            from .._dirstate_helpers_pyx import update_entry
 
789
            from breezy.bzr._dirstate_helpers_pyx import update_entry
790
790
        else:
791
 
            from ..dirstate import update_entry
 
791
            from breezy.bzr.dirstate import update_entry
792
792
        self.assertIs(update_entry, dirstate.update_entry)
793
793
 
794
794
    def test_process_entry(self):
795
795
        if compiled_dirstate_helpers_feature.available():
796
 
            from .._dirstate_helpers_pyx import ProcessEntryC
 
796
            from breezy.bzr._dirstate_helpers_pyx import ProcessEntryC
797
797
            self.assertIs(ProcessEntryC, dirstate._process_entry)
798
798
        else:
799
 
            from ..dirstate import ProcessEntryPython
 
799
            from breezy.bzr.dirstate import ProcessEntryPython
800
800
            self.assertIs(ProcessEntryPython, dirstate._process_entry)
801
801
 
802
802
 
1313
1313
            raise RuntimeError('stop this')
1314
1314
        self.overrideAttr(dirstate, 'is_inside', is_inside_raises)
1315
1315
        try:
1316
 
            from .. import _dirstate_helpers_pyx
 
1316
            from breezy.bzr import _dirstate_helpers_pyx
1317
1317
        except ImportError:
1318
1318
            pass
1319
1319
        else: