Skip to content

Tests for signup, login and logout endpoints #30

@nicole-mcg

Description

@nicole-mcg

Tests should be made for the SignupEndpoint, LoginEndpoint and LogoutEndpoint classes in file_server/web/endpoints/. I'm grouping these together because I feel like there could be ways to create short but extensive tests by testing some functionality together (through parameterization)

You can create a test server for endpoints with create_test_server in file_server/util/test_util.py. An example test can be found at file_server/web/endpoints/__test__/test_directory_contents.py

The following tests should be made:

Signup

  • Verify SignupEndpoint error with blank username and password (test each seperately)
  • Use SignupEndpoint to create an account, verify returned session is valid with Account.is_valid_session
  • Create auth with Account.create_auth(), Verify error when trying to create account that already exists
  • Create another account with the auth. Verify this account's session as well

Login

  • Login with created account (can be creating eith SignupEndpoint or Account.create_account), verify session
  • Verify error when username and password are incorrect (test each seperately)

Logout

  • Login with created account (can be creating eith SignupEndpoint or Account.create_account), verify session
  • Use LogoutEndpoint and verify session is no longer valid with Account.is_valid_session

Test naming conventions: https://pytest.readthedocs.io/en/reorganize-docs/new-docs/user/naming_conventions.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    back endPythongood first issueGood for newcomersstructureThis will make something more clear and less prone to programming errors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions