-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For use in Python bindings.
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
@dataclass | ||
class JsPackageConfig: | ||
module_url: str | ||
pipelines_base_url: Optional[str] = None | ||
pipeline_worker_url: Optional[str] = None |
16 changes: 16 additions & 0 deletions
16
packages/core/python/itkwasm/test/test_js_package_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
def test_itkwasm_js_package_config(): | ||
from itkwasm import JsPackageConfig | ||
module_url = 'https://cdn.jsdelivr.net/npm/@itk-wasm/[email protected]/dist/bundles/compress-stringify.js' | ||
pipelines_base_url = 'https://cdn.jsdelivr.net/npm/@itk-wasm/[email protected]/dist/pipelines' | ||
pipeline_worker_url = 'https://cdn.jsdelivr.net/npm/@itk-wasm/[email protected]/dist/web-workers/pipeline.worker.js' | ||
|
||
config = JsPackageConfig(module_url, pipelines_base_url, pipeline_worker_url) | ||
assert config.module_url == module_url | ||
assert config.pipelines_base_url == pipelines_base_url | ||
assert config.pipeline_worker_url == pipeline_worker_url | ||
|
||
config = JsPackageConfig(module_url) | ||
assert config.module_url == module_url | ||
assert config.pipelines_base_url is None | ||
assert config.pipeline_worker_url is None |