-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: add type annotation check (#5)
* feat!: type check meta defaults * feat!: type check args
- Loading branch information
1 parent
09b9907
commit c72a2b9
Showing
11 changed files
with
287 additions
and
77 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
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
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
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 |
---|---|---|
@@ -1,20 +1,15 @@ | ||
"""This module contains unit tests for nodes ModuleNode.""" | ||
|
||
import typing as t | ||
|
||
from yapyang.nodes import ModuleNode | ||
|
||
|
||
def test_given_module_node_has_annotated_dunder_namespace_cls_attribute_when_module_node_object_created_then_module_node_meta_contains_cls_attribute_annotation_and_default(): | ||
"""Test given module node has annotated dunder namespace cls attribute when module node object created then module node meta contains cls attribute annotation and default.""" | ||
def test_given_module_node_has_annotated_dunder_namespace_cls_attribute_when_module_node_object_created_then_module_node_meta_contains_cls_attribute_annotation(): | ||
"""Test given module node has annotated dunder namespace cls attribute when module node object created then module node meta contains cls attribute annotation.""" | ||
|
||
# Given ModuleNode has annotated dunder namespace cls attribute. | ||
__namespace__ = "__namespace__" | ||
|
||
# When ModuleNode object created. | ||
|
||
# Then ModuleNode meta contains cls attribute annotation. | ||
assert ModuleNode.__meta__[__namespace__] is t.Optional[str] | ||
|
||
# Then ModuleNode meta defaults contains cls attribute default. | ||
assert ModuleNode.__meta__["__defaults__"][__namespace__] is None | ||
assert ModuleNode.__meta__[__namespace__] is str |
Oops, something went wrong.