ProPresenter updates are safe: any installed copy counts as running, the newest version opens
- newest_of picks by CFBundleShortVersionString, not file name (ProPresenter.app sorted after ProPresenter 20.1.app) - mac_start takes newest_of; auto-setup uses it for programs on the Companion Mac - WS and SC switched over; NA's ProP restart re-rendered (same pick today) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -376,3 +376,30 @@ class TestBindingAndProbes(unittest.TestCase):
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
|
||||
class TestNewestCopy(unittest.TestCase):
|
||||
"""An update installed beside the old copy: the newest version opens, whatever the file names."""
|
||||
|
||||
@unittest.skipUnless(sys.platform == "darwin", "reads app versions with macOS's defaults")
|
||||
def test_the_newest_version_wins_not_the_last_name(self):
|
||||
import subprocess
|
||||
from settings import builders as b
|
||||
for names in ((("Show 20.0.1.app", "20.0.1"), ("Show.app", "20.1.0")), (("Show 20.0.1.app", "20.0.1"), ("Show.app", "19.4"))):
|
||||
root = tempfile.mkdtemp(prefix="sp-apps-")
|
||||
for name, ver in names:
|
||||
os.makedirs(os.path.join(root, name, "Contents"))
|
||||
subprocess.run(["/usr/bin/defaults", "write", os.path.join(root, name, "Contents", "Info"),
|
||||
"CFBundleShortVersionString", ver], check=True)
|
||||
out = subprocess.run(["/bin/sh", "-c", b.newest_app(root + "/Show*.app") + 'echo "$APP"'],
|
||||
capture_output=True, text=True).stdout.strip()
|
||||
want = max(names, key=lambda n: tuple(int(x) for x in n[1].split(".")))[0]
|
||||
self.assertEqual(os.path.basename(out), want)
|
||||
|
||||
def test_any_copy_counts_as_running_but_never_a_helper(self):
|
||||
import re
|
||||
from settings import builders as b
|
||||
m = b.app_match("/Applications/ProPresenter*.app", "ProPresenter")
|
||||
self.assertTrue(re.search(m, "/Applications/ProPresenter 20.0.1.app/Contents/MacOS/ProPresenter"))
|
||||
self.assertTrue(re.search(m, "/Applications/ProPresenter.app/Contents/MacOS/ProPresenter"))
|
||||
self.assertFalse(re.search(m, "/Applications/ProPresenter.app/Contents/MacOS/ProPresenter Helper (Network)"))
|
||||
|
||||
Reference in New Issue
Block a user