コード例 #1
0
    def get_config(self, path):
        """
        Get the configuration for the given path.

        :param path: File path to get the configuration for.
        :type path: str
        :return: Configuration dictionary for the given path.
        :rtype: pydgeot.app.dirconfig.DirConfig
        """
        return DirConfig.get(self, path)
コード例 #2
0
ファイル: test_dirconfig.py プロジェクト: broiledmeat/pydgeot
def test_overriding(temp_app, resources):
    from pydgeot.app.dirconfig import DirConfig
    from pydgeot.processors.builtins.symlinkfallback import SymlinkFallbackProcessor

    resources.copy('test_dirconfig', temp_app.root)

    config = DirConfig.get(temp_app, os.path.join(temp_app.source_root, 'sub'))

    assert config is not None
    assert len(config.processors) == 1
    assert isinstance(config.processors[0], SymlinkFallbackProcessor)
    assert config.extra == {'testing01': 0, 'testing02': 2, 'extra': {'test': True, 'ok': 'alright'}}
コード例 #3
0
ファイル: test_dirconfig.py プロジェクト: broiledmeat/pydgeot
def test_base(temp_app, resources):
    from pydgeot.app.dirconfig import DirConfig
    from pydgeot.filesystem.glob import Glob
    from pydgeot.processors.builtins.copyfallback import CopyFallbackProcessor
    from pydgeot.processors.builtins.symlinkfallback import SymlinkFallbackProcessor

    resources.copy('test_dirconfig', temp_app.root)

    config = DirConfig.get(temp_app, temp_app.root)

    assert config is not None
    assert len(config.processors) == 2
    assert any([isinstance(proc, CopyFallbackProcessor) for proc in config.processors])
    assert any([isinstance(proc, SymlinkFallbackProcessor) for proc in config.processors])
    assert config.ignore == {Glob('**/.ignore')}