-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
back endPythonPythongood first issueGood for newcomersGood for newcomersstructureThis will make something more clear and less prone to programming errorsThis will make something more clear and less prone to programming errors
Description
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
SignupEndpointerror with blank username and password (test each seperately) - Use
SignupEndpointto create an account, verify returned session is valid withAccount.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
SignupEndpointorAccount.create_account), verify session - Verify error when username and password are incorrect (test each seperately)
Logout
- Login with created account (can be creating eith
SignupEndpointorAccount.create_account), verify session - Use
LogoutEndpointand verify session is no longer valid withAccount.is_valid_session
Test naming conventions: https://pytest.readthedocs.io/en/reorganize-docs/new-docs/user/naming_conventions.html
Metadata
Metadata
Assignees
Labels
back endPythonPythongood first issueGood for newcomersGood for newcomersstructureThis will make something more clear and less prone to programming errorsThis will make something more clear and less prone to programming errors