File: conftest.py

package info (click to toggle)
python-idasen 0.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 256 kB
  • sloc: python: 976; makefile: 8
file content (20 lines) | stat: -rw-r--r-- 563 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from typing import Optional
from idasen import IdasenDesk
from tests.test_idasen import MockBleakClient
import asyncio
import pytest


@pytest.fixture(autouse=True)
def add_desk(doctest_namespace: dict):
    class DoctestDesk(IdasenDesk):
        def __init__(self, mac: str):
            super().__init__(mac=mac)
            self._client = MockBleakClient()

        @staticmethod
        async def discover() -> Optional[str]:
            return "AA:AA:AA:AA:AA:AA"

    doctest_namespace["IdasenDesk"] = DoctestDesk
    doctest_namespace["asyncio"] = asyncio