Skip to content
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

Improve API test coverage #96

Open
29 tasks
cmd-ntrf opened this issue Jun 15, 2022 · 0 comments
Open
29 tasks

Improve API test coverage #96

cmd-ntrf opened this issue Jun 15, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@cmd-ntrf
Copy link
Member

cmd-ntrf commented Jun 15, 2022

Name                                                      Stmts   Miss  Cover
-----------------------------------------------------------------------------
mchub/resources/api_view.py                                  61      7    89%   85-91, 116
mchub/resources/available_resources_api.py                   23     15    35%   13-37
mchub/resources/magic_castle_api.py                          50      4    92%   30, 36, 41, 55
mchub/resources/progress_api.py                              17      0   100%
mchub/resources/project_api.py                               77     41    47%   15-30, 44, 49-50, 54-55, 74-107, 112, 114, 118
mchub/resources/template_api.py                               6      1    83%   8
mchub/resources/user_api.py                                   5      0   100%

Missing tests:

  • mchub/resources/api_view.py
    • test accessing the interface with a local user not already in the database
    • TokenSuperUser
  • mchub/resources/available_resources_api.py
    • with hostname
      • project now shared with user -> cluster exception
      • test with cluster + project owned by user
    • with cloud id
      • test project own by user
      • test invalid project id -> empty return
      • test project not shared with user -> empty return
    • without hostname and cloud id
      • empty return
  • mchub/resources/magic_castle_api.py
    • test post with invalid project
    • test post-apply without data
    • test post-apply on invalid project or project not owned by user
    • test put without data
  • mchub/resources/project_api.py
    • test GET with project id
    • test GET with project id not owned by user
    • test POST without data
    • test POST without all required fields in DATA
    • test POST with missing environment variables
    • test PATCH
      • add user to a project
      • remove user from a project
      • add user to an invalid project
      • edit project when not admin
    • test DELETE
      • project not owned or invalid id
      • project with active clusters
  • mchub/resources/template_api.py
    • test getting default Magic Castle template
@cmd-ntrf cmd-ntrf added the enhancement New feature or request label Jun 15, 2022
@cmd-ntrf cmd-ntrf self-assigned this Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant