Exemplo n.º 1
0
def test_find_parents(tmpdir):
    subsubdir = tmpdir.ensure_dir("subdir", "subsubdir")
    path = subsubdir.ensure("path.py")
    test_cfg = tmpdir.ensure("test.cfg")

    assert _utils.find_parents(tmpdir.strpath, path.strpath,
                               ["test.cfg"]) == [test_cfg.strpath]
Exemplo n.º 2
0
 def find_parents(self, path, names):
     root_path = uris.to_fs_path(self._root_uri)
     return _utils.find_parents(root_path, path, names)
Exemplo n.º 3
0
 def project_config(self, document_path):
     files = find_parents(self.root_path, document_path, PROJECT_CONFIGS)
     config = self.read_config_from_files(files)
     return self.parse_config(config, CONFIG_KEY, OPTIONS)