~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/features.py

  • Committer: Shannon Weyrick
  • Date: 2011-11-16 20:59:10 UTC
  • mto: This revision was merged to the branch mainline in revision 6268.
  • Revision ID: weyrick@mozek.us-20111116205910-1xbpqbimbw3fvfqw
A version of the patch, based on suggestions from John Meinel, which detects an empty page differently to avoid false positives.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib import (
27
27
    osutils,
28
28
    symbol_versioning,
 
29
    tests,
29
30
    )
30
31
 
31
32
 
140
141
                                            % (self._module, self._name))
141
142
            use_msg = ' Use %s.%s instead.' % (self._replacement_module,
142
143
                                               self._replacement_name)
143
 
            symbol_versioning.warn(depr_msg + use_msg, DeprecationWarning,
144
 
                                   stacklevel=5)
 
144
            symbol_versioning.warn(depr_msg + use_msg, DeprecationWarning)
145
145
            # Import the new feature and use it as a replacement for the
146
146
            # deprecated one.
147
147
            self._feature = pyutils.get_named_object(
290
290
        if CaseInsCasePresFilenameFeature.available():
291
291
            return False
292
292
 
293
 
        from bzrlib import tests
294
 
 
295
293
        if tests.TestCaseWithMemoryTransport.TEST_ROOT is None:
296
294
            root = osutils.mkdtemp(prefix='testbzr-', suffix='.tmp')
297
295
            tests.TestCaseWithMemoryTransport.TEST_ROOT = root
409
407
 
410
408
 
411
409
bash_feature = ExecutableFeature('bash')
 
410
sed_feature = ExecutableFeature('sed')
412
411
diff_feature = ExecutableFeature('diff')
413
 
sed_feature = ExecutableFeature('sed')
414
 
msgmerge_feature = ExecutableFeature('msgmerge')
415
412
 
416
413
 
417
414
class _PosixPermissionsFeature(Feature):
424
421
            f = tempfile.mkstemp(prefix='bzr_perms_chk_')
425
422
            fd, name = f
426
423
            os.close(fd)
427
 
            osutils.chmod_if_possible(name, write_perms)
 
424
            os.chmod(name, write_perms)
428
425
 
429
426
            read_perms = os.stat(name).st_mode & 0777
430
427
            os.unlink(name)
493
490
 
494
491
 
495
492
win32_feature = Win32Feature()
 
493
 
 
494
 
 
495
for name in ['HTTPServerFeature', 
 
496
    'HTTPSServerFeature', 'SymlinkFeature', 'HardlinkFeature',
 
497
    'OsFifoFeature', 'UnicodeFilenameFeature',
 
498
    'ByteStringNamedFilesystem', 'UTF8Filesystem',
 
499
    'BreakinFeature', 'CaseInsCasePresFilenameFeature',
 
500
    'CaseInsensitiveFilesystemFeature', 'case_sensitive_filesystem_feature',
 
501
    'posix_permissions_feature',
 
502
    ]:
 
503
    setattr(tests, name, _CompatabilityThunkFeature(
 
504
        symbol_versioning.deprecated_in((2, 5, 0)),
 
505
        'bzrlib.tests', name,
 
506
        name, 'bzrlib.tests.features'))
 
507
 
 
508
 
 
509
for (old_name, new_name) in [
 
510
    ('UnicodeFilename', 'UnicodeFilenameFeature'),
 
511
    ]:
 
512
    setattr(tests, name, _CompatabilityThunkFeature(
 
513
        symbol_versioning.deprecated_in((2, 5, 0)),
 
514
        'bzrlib.tests', old_name,
 
515
        new_name, 'bzrlib.tests.features'))