/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/features.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import sys
24
24
import tempfile
25
25
 
26
 
from bzrlib import (
 
26
from .. import (
27
27
    osutils,
28
28
    symbol_versioning,
29
29
    )
135
135
 
136
136
    def _ensure(self):
137
137
        if self._feature is None:
138
 
            from bzrlib import pyutils
 
138
            from breezy import pyutils
139
139
            depr_msg = self._dep_version % ('%s.%s'
140
140
                                            % (self._module, self._name))
141
141
            use_msg = ' Use %s.%s instead.' % (self._replacement_module,
235
235
    """Does this platform support the breakin feature?"""
236
236
 
237
237
    def _probe(self):
238
 
        from bzrlib import breakin
 
238
        from breezy import breakin
239
239
        if breakin.determine_signal() is None:
240
240
            return False
241
241
        if sys.platform == 'win32':
290
290
        if CaseInsCasePresFilenameFeature.available():
291
291
            return False
292
292
 
293
 
        from bzrlib import tests
 
293
        from breezy import tests
294
294
 
295
295
        if tests.TestCaseWithMemoryTransport.TEST_ROOT is None:
296
296
            root = osutils.mkdtemp(prefix='testbzr-', suffix='.tmp')
356
356
testtools = ModuleAvailableFeature('testtools')
357
357
 
358
358
compiled_patiencediff_feature = ModuleAvailableFeature(
359
 
    'bzrlib._patiencediff_c')
360
 
lsprof_feature = ModuleAvailableFeature('bzrlib.lsprof')
 
359
    'breezy._patiencediff_c')
 
360
lsprof_feature = ModuleAvailableFeature('breezy.lsprof')
361
361
 
362
362
 
363
363
class _BackslashDirSeparatorFeature(Feature):
425
425
            os.close(fd)
426
426
            osutils.chmod_if_possible(name, write_perms)
427
427
 
428
 
            read_perms = os.stat(name).st_mode & 0777
 
428
            read_perms = os.stat(name).st_mode & 0o777
429
429
            os.unlink(name)
430
430
            return (write_perms == read_perms)
431
431
 
447
447
                stdout=subprocess.PIPE)
448
448
            proc.communicate()
449
449
            return True
450
 
        except OSError, e:
 
450
        except OSError as e:
451
451
            if e.errno == errno.ENOENT:
452
452
                # strace is not installed
453
453
                return False
468
468
            return False
469
469
        try:
470
470
            proc = subprocess.Popen(['attrib', '.'], stdout=subprocess.PIPE)
471
 
        except OSError, e:
 
471
        except OSError as e:
472
472
            return False
473
473
        return (0 == proc.wait())
474
474
 
497
497
class _ColorFeature(Feature):
498
498
 
499
499
    def _probe(self):
500
 
        from bzrlib._termcolor import allow_color
 
500
        from breezy._termcolor import allow_color
501
501
        return allow_color()
502
502
 
503
503
    def feature_name(self):