Buckets:

download
raw
1.17 kB
from pathlib import Path
import yaml
from tiled.client import from_profile
from tiled.config import parse_configs
from tiled.profiles import load_profiles, paths
from tiled.server.app import build_app_from_config
here = Path(__file__).parent.absolute()
def test_config_imports_custom_python_module():
"Configs can import from Python modules located in their same directory."
config_path = here / ".." / "example_configs" / "custom_export_formats"
parsed_config = parse_configs(config_path)
build_app_from_config(parsed_config)
def test_direct_profile(tmpdir):
profile_content = {
"test": {"direct": {"trees": [{"path": "/", "tree": "custom_module:tree"}]}}
}
with open(tmpdir / "example.yml", "w") as yaml_file:
yaml_file.write(yaml.dump(profile_content))
with open(tmpdir / "custom_module.py", "w") as py_file:
py_file.write(
"from tiled.adapters.mapping import MapAdapter; tree = MapAdapter({})"
)
profile_dir = Path(tmpdir)
try:
paths.append(profile_dir)
load_profiles.cache_clear()
from_profile("test")
finally:
paths.remove(profile_dir)

Xet Storage Details

Size:
1.17 kB
·
Xet hash:
3cb96540470e85013376dc7f991c034f58b6f7f6b3e528a611fc38f7110b45c2

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.