# Path: virtool/users/utils.py
# PERMISSIONS = [
#     "cancel_job",
#     "create_ref",
#     "create_sample",
#     "modify_hmm",
#     "modify_subtraction",
#     "remove_file",
#     "remove_job",
#     "upload_file",
# ]
# 
# def hash_password(password: str) -> str:
#     """
#     Salt and hash a unicode password. Uses bcrypt.
# 
#     :param password: a password string to salt and hash
#     :return: a salt and hashed password
# 
#     """
#     return bcrypt.hashpw(password.encode(), bcrypt.gensalt(12))


import pytest
from virtool.users.utils import PERMISSIONS, hash_password


async def test_get(snapshot, spawn_client, static_time):
    client = await spawn_client(authorize=True)

    resp = await client.get("/account")

    assert resp.status == 200
    assert await resp.json() == snapshot

    assert await resp.json() == {
        "groups": [],
        "handle": "bob",
        "id": "test",
        "administrator": False,
        "last_password_change": static_time.iso,
        "permissions": {p: False for p in PERMISSIONS},
        "primary_group": "technician",
        "settings": {

# Path: virtool/users/utils.py
# PERMISSIONS = [
#     "cancel_job",
#     "create_ref",
#     "create_sample",
#     "modify_hmm",
#     "modify_subtraction",
#     "remove_file",
#     "remove_job",
#     "upload_file",
# ]
# 
# def hash_password(password: str) -> str:
#     """
#     Salt and hash a unicode password. Uses bcrypt.
# 
#     :param password: a password string to salt and hash
#     :return: a salt and hashed password
# 
#     """
#     return bcrypt.hashpw(password.encode(), bcrypt.gensalt(12))


# Path: tests/account/test_api.py
import pytest
from virtool.users.utils import PERMISSIONS, hash_password



async def test_get(snapshot, spawn_client, static_time):
    client = await spawn_client(authorize=True)

    resp = await client.get("/account")

    assert resp.status == 200
    assert await resp.json() == snapshot

    assert await resp.json() == {
        "groups": [],
        "handle": "bob",
        "id": "test",
        "administrator": False,
        "last_password_change": static_time.iso,
        "permissions": {p: False for p in PERMISSIONS},
        "primary_group": "technician",
        "settings": {

            "quick_analyze_workflow": "pathoscope_bowtie",