Remove duplicate fixture from bsblan (#104612)

This commit is contained in:
Jan-Philipp Benecke 2023-11-27 21:35:13 +01:00 committed by GitHub
parent b994141bc6
commit 7efc581a48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 20 deletions

View file

@ -38,25 +38,15 @@ def mock_setup_entry() -> Generator[AsyncMock, None, None]:
yield mock_setup
@pytest.fixture
def mock_bsblan_config_flow() -> Generator[None, MagicMock, None]:
"""Return a mocked BSBLAN client."""
with patch(
"homeassistant.components.bsblan.config_flow.BSBLAN", autospec=True
) as bsblan_mock:
bsblan = bsblan_mock.return_value
bsblan.device.return_value = Device.parse_raw(
load_fixture("device.json", DOMAIN)
)
bsblan.info.return_value = Info.parse_raw(load_fixture("info.json", DOMAIN))
yield bsblan
@pytest.fixture
def mock_bsblan(request: pytest.FixtureRequest) -> Generator[None, MagicMock, None]:
"""Return a mocked BSBLAN client."""
with patch("homeassistant.components.bsblan.BSBLAN", autospec=True) as bsblan_mock:
with patch(
"homeassistant.components.bsblan.BSBLAN", autospec=True
) as bsblan_mock, patch(
"homeassistant.components.bsblan.config_flow.BSBLAN", new=bsblan_mock
):
bsblan = bsblan_mock.return_value
bsblan.info.return_value = Info.parse_raw(load_fixture("info.json", DOMAIN))
bsblan.device.return_value = Device.parse_raw(