/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/features.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""A collection of commonly used 'Features' to optionally run tests.
18
18
"""
19
19
 
20
 
from __future__ import absolute_import
21
 
 
22
20
import importlib
23
21
import os
24
22
import subprocess
404
402
testtools = ModuleAvailableFeature('testtools')
405
403
flake8 = ModuleAvailableFeature('flake8.api.legacy')
406
404
 
407
 
compiled_patiencediff_feature = ModuleAvailableFeature(
408
 
    'breezy._patiencediff_c')
409
405
lsprof_feature = ModuleAvailableFeature('breezy.lsprof')
 
406
pkg_resources_feature = ModuleAvailableFeature('pkg_resources')
 
407
 
 
408
pyinotify = ModuleAvailableFeature('pyinotify')
410
409
 
411
410
 
412
411
class _BackslashDirSeparatorFeature(Feature):
567
566
 
568
567
 
569
568
BackslashFilenameFeature = _BackslashFilenameFeature()
 
569
 
 
570
 
 
571
class PathFeature(Feature):
 
572
    """Feature testing whether a particular path exists."""
 
573
 
 
574
    def __init__(self, path):
 
575
        super(PathFeature, self).__init__()
 
576
        self.path = path
 
577
 
 
578
    def _probe(self):
 
579
        return os.path.exists(self.path)
 
580
 
 
581
    def feature_name(self):
 
582
        return "%s exists" % self.path