/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: 2017-05-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
import time
22
22
 
23
 
from brzlib import (
 
23
from breezy import (
24
24
    dirstate,
25
25
    errors,
26
26
    osutils,
27
27
    tests,
28
28
    _dirstate_helpers_py,
29
29
    )
30
 
from brzlib.tests import (
 
30
from breezy.tests import (
31
31
    test_dirstate,
32
32
    )
33
 
from brzlib.tests.test_osutils import dir_reader_scenarios
34
 
from brzlib.tests.scenarios import (
 
33
from breezy.tests.test_osutils import dir_reader_scenarios
 
34
from breezy.tests.scenarios import (
35
35
    load_tests_apply_scenarios,
36
36
    multiply_scenarios,
37
37
    )
38
 
from brzlib.tests import (
 
38
from breezy.tests import (
39
39
    features,
40
40
    )
41
41
 
44
44
 
45
45
 
46
46
compiled_dirstate_helpers_feature = features.ModuleAvailableFeature(
47
 
    'brzlib._dirstate_helpers_pyx')
 
47
    'breezy._dirstate_helpers_pyx')
48
48
 
49
49
 
50
50
# FIXME: we should also parametrize against SHA1Provider !
226
226
    """Run all Bisect Path tests against _bisect_path_left."""
227
227
 
228
228
    def get_bisect_path(self):
229
 
        from brzlib._dirstate_helpers_py import _bisect_path_left
 
229
        from breezy._dirstate_helpers_py import _bisect_path_left
230
230
        return _bisect_path_left
231
231
 
232
232
    def get_bisect(self):
239
239
    _test_needs_features = [compiled_dirstate_helpers_feature]
240
240
 
241
241
    def get_bisect_path(self):
242
 
        from brzlib._dirstate_helpers_pyx import _bisect_path_left
 
242
        from breezy._dirstate_helpers_pyx import _bisect_path_left
243
243
        return _bisect_path_left
244
244
 
245
245
 
247
247
    """Run all Bisect Path tests against _bisect_path_right"""
248
248
 
249
249
    def get_bisect_path(self):
250
 
        from brzlib._dirstate_helpers_py import _bisect_path_right
 
250
        from breezy._dirstate_helpers_py import _bisect_path_right
251
251
        return _bisect_path_right
252
252
 
253
253
    def get_bisect(self):
260
260
    _test_needs_features = [compiled_dirstate_helpers_feature]
261
261
 
262
262
    def get_bisect_path(self):
263
 
        from brzlib._dirstate_helpers_pyx import _bisect_path_right
 
263
        from breezy._dirstate_helpers_pyx import _bisect_path_right
264
264
        return _bisect_path_right
265
265
 
266
266
 
278
278
 
279
279
    def get_bisect_dirblock(self):
280
280
        """Return an implementation of bisect_dirblock"""
281
 
        from brzlib._dirstate_helpers_py import bisect_dirblock
 
281
        from breezy._dirstate_helpers_py import bisect_dirblock
282
282
        return bisect_dirblock
283
283
 
284
284
    def assertBisect(self, dirblocks, split_dirblocks, path, *args, **kwargs):
372
372
    _test_needs_features = [compiled_dirstate_helpers_feature]
373
373
 
374
374
    def get_bisect_dirblock(self):
375
 
        from brzlib._dirstate_helpers_pyx import bisect_dirblock
 
375
        from breezy._dirstate_helpers_pyx import bisect_dirblock
376
376
        return bisect_dirblock
377
377
 
378
378
 
388
388
 
389
389
    def get_cmp_by_dirs(self):
390
390
        """Get a specific implementation of cmp_by_dirs."""
391
 
        from brzlib._dirstate_helpers_py import cmp_by_dirs
 
391
        from breezy._dirstate_helpers_py import cmp_by_dirs
392
392
        return cmp_by_dirs
393
393
 
394
394
    def assertCmpByDirs(self, expected, str1, str2):
494
494
    _test_needs_features = [compiled_dirstate_helpers_feature]
495
495
 
496
496
    def get_cmp_by_dirs(self):
497
 
        from brzlib._dirstate_helpers_pyx import cmp_by_dirs
 
497
        from breezy._dirstate_helpers_pyx import cmp_by_dirs
498
498
        return cmp_by_dirs
499
499
 
500
500
 
510
510
 
511
511
    def get_cmp_path_by_dirblock(self):
512
512
        """Get a specific implementation of _cmp_path_by_dirblock."""
513
 
        from brzlib._dirstate_helpers_py import _cmp_path_by_dirblock
 
513
        from breezy._dirstate_helpers_py import _cmp_path_by_dirblock
514
514
        return _cmp_path_by_dirblock
515
515
 
516
516
    def assertCmpPathByDirblock(self, paths):
645
645
    _test_needs_features = [compiled_dirstate_helpers_feature]
646
646
 
647
647
    def get_cmp_by_dirs(self):
648
 
        from brzlib._dirstate_helpers_pyx import _cmp_path_by_dirblock
 
648
        from breezy._dirstate_helpers_pyx import _cmp_path_by_dirblock
649
649
        return _cmp_path_by_dirblock
650
650
 
651
651
 
655
655
    _test_needs_features = [compiled_dirstate_helpers_feature]
656
656
 
657
657
    def assertMemRChr(self, expected, s, c):
658
 
        from brzlib._dirstate_helpers_pyx import _py_memrchr
 
658
        from breezy._dirstate_helpers_pyx import _py_memrchr
659
659
        self.assertEqual(expected, _py_memrchr(s, c))
660
660
 
661
661
    def test_missing(self):
705
705
    # inherits scenarios from test_dirstate
706
706
 
707
707
    def get_read_dirblocks(self):
708
 
        from brzlib._dirstate_helpers_py import _read_dirblocks
 
708
        from breezy._dirstate_helpers_py import _read_dirblocks
709
709
        return _read_dirblocks
710
710
 
711
711
    def test_smoketest(self):
745
745
    _test_needs_features = [compiled_dirstate_helpers_feature]
746
746
 
747
747
    def get_read_dirblocks(self):
748
 
        from brzlib._dirstate_helpers_pyx import _read_dirblocks
 
748
        from breezy._dirstate_helpers_pyx import _read_dirblocks
749
749
        return _read_dirblocks
750
750
 
751
751
 
759
759
 
760
760
    def test_bisect_dirblock(self):
761
761
        if compiled_dirstate_helpers_feature.available():
762
 
            from brzlib._dirstate_helpers_pyx import bisect_dirblock
 
762
            from breezy._dirstate_helpers_pyx import bisect_dirblock
763
763
        else:
764
 
            from brzlib._dirstate_helpers_py import bisect_dirblock
 
764
            from breezy._dirstate_helpers_py import bisect_dirblock
765
765
        self.assertIs(bisect_dirblock, dirstate.bisect_dirblock)
766
766
 
767
767
    def test__bisect_path_left(self):
768
768
        if compiled_dirstate_helpers_feature.available():
769
 
            from brzlib._dirstate_helpers_pyx import _bisect_path_left
 
769
            from breezy._dirstate_helpers_pyx import _bisect_path_left
770
770
        else:
771
 
            from brzlib._dirstate_helpers_py import _bisect_path_left
 
771
            from breezy._dirstate_helpers_py import _bisect_path_left
772
772
        self.assertIs(_bisect_path_left, dirstate._bisect_path_left)
773
773
 
774
774
    def test__bisect_path_right(self):
775
775
        if compiled_dirstate_helpers_feature.available():
776
 
            from brzlib._dirstate_helpers_pyx import _bisect_path_right
 
776
            from breezy._dirstate_helpers_pyx import _bisect_path_right
777
777
        else:
778
 
            from brzlib._dirstate_helpers_py import _bisect_path_right
 
778
            from breezy._dirstate_helpers_py import _bisect_path_right
779
779
        self.assertIs(_bisect_path_right, dirstate._bisect_path_right)
780
780
 
781
781
    def test_cmp_by_dirs(self):
782
782
        if compiled_dirstate_helpers_feature.available():
783
 
            from brzlib._dirstate_helpers_pyx import cmp_by_dirs
 
783
            from breezy._dirstate_helpers_pyx import cmp_by_dirs
784
784
        else:
785
 
            from brzlib._dirstate_helpers_py import cmp_by_dirs
 
785
            from breezy._dirstate_helpers_py import cmp_by_dirs
786
786
        self.assertIs(cmp_by_dirs, dirstate.cmp_by_dirs)
787
787
 
788
788
    def test__read_dirblocks(self):
789
789
        if compiled_dirstate_helpers_feature.available():
790
 
            from brzlib._dirstate_helpers_pyx import _read_dirblocks
 
790
            from breezy._dirstate_helpers_pyx import _read_dirblocks
791
791
        else:
792
 
            from brzlib._dirstate_helpers_py import _read_dirblocks
 
792
            from breezy._dirstate_helpers_py import _read_dirblocks
793
793
        self.assertIs(_read_dirblocks, dirstate._read_dirblocks)
794
794
 
795
795
    def test_update_entry(self):
796
796
        if compiled_dirstate_helpers_feature.available():
797
 
            from brzlib._dirstate_helpers_pyx import update_entry
 
797
            from breezy._dirstate_helpers_pyx import update_entry
798
798
        else:
799
 
            from brzlib.dirstate import update_entry
 
799
            from breezy.dirstate import update_entry
800
800
        self.assertIs(update_entry, dirstate.update_entry)
801
801
 
802
802
    def test_process_entry(self):
803
803
        if compiled_dirstate_helpers_feature.available():
804
 
            from brzlib._dirstate_helpers_pyx import ProcessEntryC
 
804
            from breezy._dirstate_helpers_pyx import ProcessEntryC
805
805
            self.assertIs(ProcessEntryC, dirstate._process_entry)
806
806
        else:
807
 
            from brzlib.dirstate import ProcessEntryPython
 
807
            from breezy.dirstate import ProcessEntryPython
808
808
            self.assertIs(ProcessEntryPython, dirstate._process_entry)
809
809
 
810
810