Skip to content

Commit 038a848

Browse files
authored
Fix androidtv isfile patcher in tests (home-assistant#146696)
1 parent ff17d79 commit 038a848

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/components/androidtv/patchers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Define patches used for androidtv tests."""
22

3+
import os.path
34
from typing import Any
45
from unittest.mock import patch
56

@@ -12,6 +13,8 @@
1213
DEVICE_FIRETV,
1314
)
1415

16+
_original_isfile = os.path.isfile
17+
1518
ADB_SERVER_HOST = "127.0.0.1"
1619
KEY_PYTHON = "python"
1720
KEY_SERVER = "server"
@@ -185,7 +188,9 @@ def patch_androidtv_update(
185188

186189
def isfile(filepath):
187190
"""Mock `os.path.isfile`."""
188-
return filepath.endswith("adbkey")
191+
if str(filepath).endswith("adbkey"):
192+
return True
193+
return _original_isfile(filepath)
189194

190195

191196
PATCH_SCREENCAP = patch(

0 commit comments

Comments
 (0)