Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

tests: the theme suites run their theme.ps1 checks on Windows without the symlink privilege

editorrylixb5539efad131
diff --git a/tests/test_theme_config_root.py b/tests/test_theme_config_root.py
index 6636edc1d..769744d44 100644
--- a/tests/test_theme_config_root.py
+++ b/tests/test_theme_config_root.py
@@ -45,7 +45,13 @@ class ThemeConfigRootTest(unittest.TestCase):
(self.tools / "tv.py").write_text(FAKE_TV)
venv = self.tools / "venv" / "bin"
venv.mkdir(parents=True)
- (venv / "python").symlink_to(sys.executable)
+ try:
+ (venv / "python").symlink_to(sys.executable)
+ except OSError:
+ # Windows without the symlink privilege (WinError 1314). Only the theme.sh runs use this
+ # python, and they skip there; the checks of theme.ps1 still run.
+ if os.name != "nt":
+ raise
self.theme = self.base / "my-theme"
self.theme.mkdir()
self.log = self.base / "tv-calls.log"
diff --git a/tests/test_theme_exit_status.py b/tests/test_theme_exit_status.py
index 069acdb8e..cae9052f9 100644
--- a/tests/test_theme_exit_status.py
+++ b/tests/test_theme_exit_status.py
@@ -62,7 +62,13 @@ class ThemeExitStatusTest(unittest.TestCase):
(self.tools / "tv.py").write_text(FAKE_TV)
venv = self.tools / "venv" / "bin"
venv.mkdir(parents=True)
- (venv / "python").symlink_to(sys.executable)
+ try:
+ (venv / "python").symlink_to(sys.executable)
+ except OSError:
+ # Windows without the symlink privilege (WinError 1314). Only the theme.sh runs use this
+ # python, and they skip there; the checks of theme.ps1 still run.
+ if os.name != "nt":
+ raise
self.theme = self.base / "my-theme"
self.theme.mkdir()
(self.theme / "config.json").write_text('{"background_color": "#000000"}\n', encoding="utf-8")
diff --git a/tests/test_theme_one_argument.py b/tests/test_theme_one_argument.py
index 7138dbaf5..62ba18fe5 100644
--- a/tests/test_theme_one_argument.py
+++ b/tests/test_theme_one_argument.py
@@ -51,7 +51,13 @@ class ThemeOneArgumentTest(unittest.TestCase):
(self.tools / "tv.py").write_text(FAKE_TV)
venv = self.tools / "venv" / "bin"
venv.mkdir(parents=True)
- (venv / "python").symlink_to(sys.executable)
+ try:
+ (venv / "python").symlink_to(sys.executable)
+ except OSError:
+ # Windows without the symlink privilege (WinError 1314). Only the theme.sh runs use this
+ # python, and they skip there; the checks of theme.ps1 still run.
+ if os.name != "nt":
+ raise
self.theme = self.base / "my-theme"
self.theme.mkdir()
(self.theme / "config.json").write_text('{"background_color": "#000000"}\n', encoding="utf-8")
diff --git a/tests/test_theme_push_ownership.py b/tests/test_theme_push_ownership.py
index 326bc4a74..7c1a4b0f9 100644
--- a/tests/test_theme_push_ownership.py
+++ b/tests/test_theme_push_ownership.py
@@ -133,7 +133,13 @@ class ThemePushTest(unittest.TestCase):
(self.tools / "tv.py").write_text(FAKE_TV)
venv = self.tools / "venv" / "bin"
venv.mkdir(parents=True)
- (venv / "python").symlink_to(sys.executable)
+ try:
+ (venv / "python").symlink_to(sys.executable)
+ except OSError:
+ # Windows without the symlink privilege (WinError 1314). Only the theme.sh runs use this
+ # python, and they skip there; the checks of theme.ps1 still run.
+ if os.name != "nt":
+ raise
self.bin = self.base / "bin"
self.bin.mkdir()
content = self.bin / "content"