File: conftest.py

package info (click to toggle)
python-apsystems-ez1 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,328 kB
  • sloc: python: 697; makefile: 5
file content (12 lines) | stat: -rw-r--r-- 376 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
import pytest
import APsystemsEZ1
from unittest.mock import AsyncMock
from typing import Any

@pytest.fixture(scope="function")
def mock_response():
    def inner(return_values: Any) -> APsystemsEZ1.APsystemsEZ1M:
        ez1m = APsystemsEZ1.APsystemsEZ1M(ip_address="0.0.0.0")
        ez1m._request = AsyncMock(return_value=return_values)
        return ez1m
    yield inner