Skip to content

Add tests #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions atest/DynamicTypesAnnotationsLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,9 @@ def kw_with_many_named_arguments(self, *, arg1, arg2):
def kw_with_named_arguments_and_variable_number_args(self, *varargs, arg):
print(arg)
return f"arg: {arg}, type: {type(arg)}"

@keyword
def kw_with_many_named_arguments_with_default(self, *, arg1, arg2: int):
print(arg1)
print(arg2)
return f"arg1: {arg1}, type: {type(arg1)}, arg2: {arg2}, type: {type(arg2)}"
5 changes: 5 additions & 0 deletions utest/test_get_keyword_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,8 @@ def test_keyword_union_with_none(lib_types):
def test_kw_with_named_arguments(lib_types: DynamicTypesAnnotationsLibrary):
types = lib_types.get_keyword_types("kw_with_named_arguments")
assert types == {}


def test_kw_with_many_named_arguments_with_default(lib_types: DynamicTypesAnnotationsLibrary):
types = lib_types.get_keyword_types("kw_with_many_named_arguments_with_default")
assert types == {'arg2': int}
1 change: 1 addition & 0 deletions utest/test_robotlibcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def test_named_only_argumens():
assert args("kw_with_named_arguments") == ["*", "arg"]
assert args("kw_with_many_named_arguments") == ["*", "arg1", "arg2"]
assert args("kw_with_named_arguments_and_variable_number_args") == ["*varargs", "arg"]
assert args("kw_with_many_named_arguments_with_default") == ["*", "arg1", "arg2"]


def test_get_keyword_documentation():
Expand Down