# Path: virtool/fake/wrapper.py
# class FakerWrapper:
#     def __init__(self):
#         self.fake = Faker()
#         self.fake.seed_instance(0)
#         self.fake.add_provider(address)
#         self.fake.add_provider(misc)
#         self.fake.add_provider(lorem)
#         self.fake.add_provider(python)
#         self.fake.add_provider(date_time)
#         self.fake.add_provider(profile)
# 
#         self.country = self.fake.country
# 
#         self.text = self.fake.text
#         self.word = self.fake.word
#         self.words = self.fake.words
# 
#         self.integer = self.fake.pyint
#         self.list = self.fake.pylist
#         self.boolean = self.fake.pybool
#         self.profile = self.fake.profile
#         self.date_time = self.fake.date_time
#         self.random_element = self.fake.random_element
# 
#     def get_mongo_id(self) -> str:
#         """
#         Create a predictable, fake ID for MongoDB that imitates Virtool IDs.
# 
#         :return: a fake MongoDB ID
# 
#         """
#         return self.fake.password(length=8, special_chars=False)


from abc import ABC, abstractmethod
from attr import dataclass
from faker.proxy import Faker
from virtool.fake.wrapper import FakerWrapper
import pytest
            "administrator": False,
            "created_at": self._faker.date_time(),
        }

    async def insert(self):
        document = await self.create()
        await self._db.users.insert_one(document)
        return document

    async def get_id(self):
        id_list = await self._db.users.distinct("_id")

        if id_list:
            return self._faker.random_element(id_list)

        document = await self.insert()

        return document["_id"]


class FakeGenerator:
    def __init__(self, db):
        self.jobs = FakeJobGenerator(self, db)
        self.users = FakeUserGenerator(self, db)


@pytest.fixture
def app(dbi, pg, tmp_path, config, settings):
    return {
        "db": dbi,

# Path: virtool/fake/wrapper.py
# class FakerWrapper:
#     def __init__(self):
#         self.fake = Faker()
#         self.fake.seed_instance(0)
#         self.fake.add_provider(address)
#         self.fake.add_provider(misc)
#         self.fake.add_provider(lorem)
#         self.fake.add_provider(python)
#         self.fake.add_provider(date_time)
#         self.fake.add_provider(profile)
# 
#         self.country = self.fake.country
# 
#         self.text = self.fake.text
#         self.word = self.fake.word
#         self.words = self.fake.words
# 
#         self.integer = self.fake.pyint
#         self.list = self.fake.pylist
#         self.boolean = self.fake.pybool
#         self.profile = self.fake.profile
#         self.date_time = self.fake.date_time
#         self.random_element = self.fake.random_element
# 
#     def get_mongo_id(self) -> str:
#         """
#         Create a predictable, fake ID for MongoDB that imitates Virtool IDs.
# 
#         :return: a fake MongoDB ID
# 
#         """
#         return self.fake.password(length=8, special_chars=False)


# Path: tests/fixtures/fake.py
from abc import ABC, abstractmethod
from attr import dataclass
from faker.proxy import Faker
from virtool.fake.wrapper import FakerWrapper
import pytest

            "administrator": False,
            "created_at": self._faker.date_time(),
        }

    async def insert(self):
        document = await self.create()
        await self._db.users.insert_one(document)
        return document

    async def get_id(self):
        id_list = await self._db.users.distinct("_id")

        if id_list:
            return self._faker.random_element(id_list)

        document = await self.insert()

        return document["_id"]


class FakeGenerator:
    def __init__(self, db):
        self.jobs = FakeJobGenerator(self, db)
        self.users = FakeUserGenerator(self, db)


@pytest.fixture
def app(dbi, pg, tmp_path, config, settings):
    return {
        "db": dbi,

        "fake": FakerWrapper(),