Skip to content

Commit

Permalink
add tests for functional apps
Browse files Browse the repository at this point in the history
  • Loading branch information
khiron committed Apr 1, 2024
1 parent 6f75c92 commit 85b33a5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_app/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def create_extension(
)


def test_Install_app(mock_extension_manager):
def test_Install_app_class(mock_extension_manager):
@define_app
class uppercase:
"""Test app that converts a string to uppercase, and has a class docstring."""
Expand All @@ -71,6 +71,18 @@ def main(self, data: str) -> str:
assert appercase("hello") == "HELLO"
assert appercase.__doc__ in _make_apphelp_docstring(appercase.__class__)

def test_Install_app_function(mock_extension_manager):
@define_app
def uppercase(data: str) -> str:
"""Test function that converts a string to uppercase"""
return data.upper()

mock_extension_manager([create_extension(uppercase)])

appercase = get_app("uppercase")
assert appercase("hello") == "HELLO"
assert appercase.__doc__ in _make_apphelp_docstring(appercase.__class__)


@pytest.mark.parametrize("app_doc", [None, "text"])
@pytest.mark.parametrize("init_doc", [None, "text"])
Expand Down

0 comments on commit 85b33a5

Please sign in to comment.