-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check that importing a non-compliant render module throws an error
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""Testing example renderer. | ||
Correctly fails to import to show a broken module being handled. | ||
""" | ||
|
||
from typing import Unpack, TypedDict | ||
from dewret.workflow import Workflow | ||
|
||
from .extra import JUMP | ||
|
||
class NonfrenderRendererConfiguration(TypedDict): | ||
allow_complex_types: bool | ||
|
||
# This should fail to load as default_config is not present. However it would | ||
# ignore the fact that the return type is not a (subtype of) dict[str, RawType] | ||
# def default_config() -> int: | ||
# return 3 | ||
|
||
def render_raw( | ||
workflow: Workflow, **kwargs: Unpack[NonfrenderRendererConfiguration] | ||
) -> dict[str, str]: | ||
return {"JUMP": str(JUMP)} |
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