Skip to content

Tests for Account class #24

@nicole-mcg

Description

@nicole-mcg

Tests should be made for the Account class in file_server/web/account.py. The variable Account.directory can be changed in tests safely to run the methods in a test directory. This shouldn't need to be changed back, but should be set before any test with the Account class.

To get current directory for a python file:

import os, inspect
curr_path = os.path.split(inspect.stack()[0][1])[0]

The following tests should be included

  • Creating the first account without an auth
  • Generate an auth and confirm it is valid
  • Create an account with a generated auth
  • Create a session with an account and confirm session is valid, end the session and confirm session isn't valid, create a session with the same account and confirm the session is valid. Repeat with a different account used for the second session
  • Create an account, then load the account into another variable and confirm the two are equal with ==

An example test can be found at file_server/file/__test__/test_snapshot.py

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    back endPythonstructureThis 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