Skip to content

Commit

Permalink
feat(codegen): stub more realistic api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed May 7, 2024
1 parent d2e9f13 commit 572ef77
Show file tree
Hide file tree
Showing 58 changed files with 1,050 additions and 615 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def test_{{classname}}_{{{operationId}}}(api):
{{{summary}}} # noqa: E501
{{/summary}}
"""
pass
response = api.{{{operationId}}}()

assert response

{{/operation}}
{{/operations}}
9 changes: 0 additions & 9 deletions toggl_py/tests/api/__init__.py

This file was deleted.

28 changes: 0 additions & 28 deletions toggl_py/tests/api/test__api.py

This file was deleted.

16 changes: 12 additions & 4 deletions toggl_py/tests/api/test_alerts_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,36 @@ def test_AlertsApi_delete_alerts(api):
Alerts # noqa: E501
"""
pass
response = api.delete_alerts()

assert response


def test_AlertsApi_get_alerts(api):
"""Test case for get_alerts
Alerts # noqa: E501
"""
pass
response = api.get_alerts()

assert response


def test_AlertsApi_post_alerts(api):
"""Test case for post_alerts
Alerts # noqa: E501
"""
pass
response = api.post_alerts()

assert response


def test_AlertsApi_put_alerts(api):
"""Test case for put_alerts
Alerts # noqa: E501
"""
pass
response = api.put_alerts()

assert response
32 changes: 24 additions & 8 deletions toggl_py/tests/api/test_approvals_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,60 +25,76 @@ def test_ApprovalsApi_delete_timesheet_setups(api):
Delete a timesheet setup # noqa: E501
"""
pass
response = api.delete_timesheet_setups()

assert response


def test_ApprovalsApi_get_timesheet_setups(api):
"""Test case for get_timesheet_setups
Get timesheet setups # noqa: E501
"""
pass
response = api.get_timesheet_setups()

assert response


def test_ApprovalsApi_get_workspace_timesheet_hours_handler(api):
"""Test case for get_workspace_timesheet_hours_handler
Get timesheets hours # noqa: E501
"""
pass
response = api.get_workspace_timesheet_hours_handler()

assert response


def test_ApprovalsApi_get_workspace_timesheet_time_entries_handler(api):
"""Test case for get_workspace_timesheet_time_entries_handler
Get timesheet time entries # noqa: E501
"""
pass
response = api.get_workspace_timesheet_time_entries_handler()

assert response


def test_ApprovalsApi_get_workspace_timesheets_handler(api):
"""Test case for get_workspace_timesheets_handler
Get timesheets # noqa: E501
"""
pass
response = api.get_workspace_timesheets_handler()

assert response


def test_ApprovalsApi_post_timesheet_setups(api):
"""Test case for post_timesheet_setups
Create a timesheet setup # noqa: E501
"""
pass
response = api.post_timesheet_setups()

assert response


def test_ApprovalsApi_put_timesheet_setups(api):
"""Test case for put_timesheet_setups
Update a timesheet setup # noqa: E501
"""
pass
response = api.put_timesheet_setups()

assert response


def test_ApprovalsApi_put_workspace_timesheets_handler(api):
"""Test case for put_workspace_timesheets_handler
Update timesheets # noqa: E501
"""
pass
response = api.put_workspace_timesheets_handler()

assert response
8 changes: 6 additions & 2 deletions toggl_py/tests/api/test_auth_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ def test_AuthApi_desktop_login_get(api):
Get desktop login token # noqa: E501
"""
pass
response = api.desktop_login_get()

assert response


def test_AuthApi_desktop_login_tokens_post(api):
"""Test case for desktop_login_tokens_post
Post desktop login token # noqa: E501
"""
pass
response = api.desktop_login_tokens_post()

assert response
44 changes: 33 additions & 11 deletions toggl_py/tests/api/test_authentication_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,84 +25,106 @@ def test_AuthenticationApi_delete_workspace_sso(api):
Erase a workspace SSO configuration # noqa: E501
"""
pass
response = api.delete_workspace_sso()

assert response


def test_AuthenticationApi_get_saml2_login_url(api):
"""Test case for get_saml2_login_url
SAML2 Identity Provider URL # noqa: E501
"""
pass
response = api.get_saml2_login_url()

assert response


def test_AuthenticationApi_get_workspace_sso(api):
"""Test case for get_workspace_sso
Workspace SSO configuration # noqa: E501
"""
pass
response = api.get_workspace_sso()

assert response


def test_AuthenticationApi_me_sessions_delete(api):
"""Test case for me_sessions_delete
Delete session # noqa: E501
"""
pass
response = api.me_sessions_delete()

assert response


def test_AuthenticationApi_me_sessions_post(api):
"""Test case for me_sessions_post
Create session # noqa: E501
"""
pass
response = api.me_sessions_post()

assert response


def test_AuthenticationApi_patch_workspace_sso(api):
"""Test case for patch_workspace_sso
Enable/disable the Workspace SSO configuration # noqa: E501
"""
pass
response = api.patch_workspace_sso()

assert response


def test_AuthenticationApi_post_enable_sso(api):
"""Test case for post_enable_sso
Confirm SSO enabling for user account # noqa: E501
"""
pass
response = api.post_enable_sso()

assert response


def test_AuthenticationApi_post_reset_token(api):
"""Test case for post_reset_token
ResetToken # noqa: E501
"""
pass
response = api.post_reset_token()

assert response


def test_AuthenticationApi_post_saml2_callback(api):
"""Test case for post_saml2_callback
SAML2 Identity Provider Callback # noqa: E501
"""
pass
response = api.post_saml2_callback()

assert response


def test_AuthenticationApi_post_signup(api):
"""Test case for post_signup
Signup # noqa: E501
"""
pass
response = api.post_signup()

assert response


def test_AuthenticationApi_post_workspace_sso(api):
"""Test case for post_workspace_sso
Workspace SSO configuration # noqa: E501
"""
pass
response = api.post_workspace_sso()

assert response
12 changes: 9 additions & 3 deletions toggl_py/tests/api/test_avatars_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,26 @@ def test_AvatarsApi_delete_avatars(api):
Avatars # noqa: E501
"""
pass
response = api.delete_avatars()

assert response


def test_AvatarsApi_post_avatars(api):
"""Test case for post_avatars
Avatars # noqa: E501
"""
pass
response = api.post_avatars()

assert response


def test_AvatarsApi_post_use_gravatar(api):
"""Test case for post_use_gravatar
UseGravatar # noqa: E501
"""
pass
response = api.post_use_gravatar()

assert response
Loading

0 comments on commit 572ef77

Please sign in to comment.