mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Fix androidtv isfile patcher in tests (#146696)
This commit is contained in:
parent
ff17d79e73
commit
038a848d53
@ -1,5 +1,6 @@
|
||||
"""Define patches used for androidtv tests."""
|
||||
|
||||
import os.path
|
||||
from typing import Any
|
||||
from unittest.mock import patch
|
||||
|
||||
@ -12,6 +13,8 @@ from homeassistant.components.androidtv.const import (
|
||||
DEVICE_FIRETV,
|
||||
)
|
||||
|
||||
_original_isfile = os.path.isfile
|
||||
|
||||
ADB_SERVER_HOST = "127.0.0.1"
|
||||
KEY_PYTHON = "python"
|
||||
KEY_SERVER = "server"
|
||||
@ -185,7 +188,9 @@ def patch_androidtv_update(
|
||||
|
||||
def isfile(filepath):
|
||||
"""Mock `os.path.isfile`."""
|
||||
return filepath.endswith("adbkey")
|
||||
if str(filepath).endswith("adbkey"):
|
||||
return True
|
||||
return _original_isfile(filepath)
|
||||
|
||||
|
||||
PATCH_SCREENCAP = patch(
|
||||
|
Loading…
x
Reference in New Issue
Block a user