arelle-release 2.37.23__py3-none-any.whl → 2.37.25__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of arelle-release might be problematic. Click here for more details.

@@ -13,8 +13,11 @@ import pytest
13
13
  from arelle import Updater
14
14
  from arelle.Updater import ArelleRelease, ArelleVersion
15
15
 
16
- MACOS_DOWNLOAD_URL = (
17
- "https://github.com/Arelle/Arelle/releases/download/2.1.3/arelle-macos-2.1.3.dmg"
16
+ MACOS_ARM64_DOWNLOAD_URL = (
17
+ "https://github.com/Arelle/Arelle/releases/download/2.1.3/arelle-macos-arm64-2.1.3.dmg"
18
+ )
19
+ MACOS_X64_DOWNLOAD_URL = (
20
+ "https://github.com/Arelle/Arelle/releases/download/2.1.3/arelle-macos-x64-2.1.3.dmg"
18
21
  )
19
22
  WINDOWS_DOWNLOAD_URL = (
20
23
  "https://github.com/Arelle/Arelle/releases/download/2.1.3/arelle-win-2.1.3.exe"
@@ -30,7 +33,8 @@ NEW_SEMVER_VERSION = str(NEW_ARELLE_VERSION)
30
33
  def _mockGitHubRelease(
31
34
  tagName: str = NEW_SEMVER_VERSION,
32
35
  assetUrls: tuple[str] = (
33
- MACOS_DOWNLOAD_URL,
36
+ MACOS_ARM64_DOWNLOAD_URL,
37
+ MACOS_X64_DOWNLOAD_URL,
34
38
  WINDOWS_DOWNLOAD_URL,
35
39
  OTHER_DOWNLOAD_URL,
36
40
  ),
@@ -105,12 +109,37 @@ class TestArelleVersion:
105
109
 
106
110
  class TestUpdater:
107
111
  @patch("sys.platform", "darwin")
112
+ @patch("platform.machine")
113
+ @patch("tkinter.messagebox.showinfo")
114
+ @patch("tkinter.messagebox.showwarning")
115
+ def test_check_for_updates_macos(self, showWarning, showInfo, machine):
116
+ machine.return_value = "x64"
117
+ arelleRelease = ArelleRelease(
118
+ version=NEW_ARELLE_VERSION,
119
+ downloadUrl=MACOS_X64_DOWNLOAD_URL,
120
+ )
121
+ cntlr = _mockCntlrWinMain()
122
+
123
+ Updater._checkForUpdates(cntlr)
124
+
125
+ assert not showInfo.called
126
+ assert not showWarning.called
127
+ assert not cntlr.uiThreadQueue.empty()
128
+ assert cntlr.uiThreadQueue.get_nowait() == (
129
+ Updater._checkUpdateUrl,
130
+ [cntlr, arelleRelease],
131
+ )
132
+ assert cntlr.uiThreadQueue.empty()
133
+
134
+ @patch("sys.platform", "darwin")
135
+ @patch("platform.machine")
108
136
  @patch("tkinter.messagebox.showinfo")
109
137
  @patch("tkinter.messagebox.showwarning")
110
- def test_check_for_updates_macos(self, showWarning, showInfo):
138
+ def test_check_for_updates_macos(self, showWarning, showInfo, machine):
139
+ machine.return_value = "arm64"
111
140
  arelleRelease = ArelleRelease(
112
141
  version=NEW_ARELLE_VERSION,
113
- downloadUrl=MACOS_DOWNLOAD_URL,
142
+ downloadUrl=MACOS_ARM64_DOWNLOAD_URL,
114
143
  )
115
144
  cntlr = _mockCntlrWinMain()
116
145
 
@@ -219,7 +248,7 @@ class TestUpdater:
219
248
  ):
220
249
  arelleRelease = ArelleRelease(
221
250
  version=NEW_ARELLE_VERSION,
222
- downloadUrl=MACOS_DOWNLOAD_URL,
251
+ downloadUrl=MACOS_ARM64_DOWNLOAD_URL,
223
252
  )
224
253
  cntlr = _mockCntlrWinMain()
225
254
  version.version = OLD_SEMVER_VERSION
@@ -275,7 +304,7 @@ class TestUpdater:
275
304
  ):
276
305
  arelleRelease = ArelleRelease(
277
306
  version=NEW_ARELLE_VERSION,
278
- downloadUrl=MACOS_DOWNLOAD_URL,
307
+ downloadUrl=MACOS_ARM64_DOWNLOAD_URL,
279
308
  )
280
309
  cntlr = _mockCntlrWinMain()
281
310
  version.version = OLD_SEMVER_VERSION
@@ -303,7 +332,7 @@ class TestUpdater:
303
332
  ):
304
333
  arelleRelease = ArelleRelease(
305
334
  version=OLD_ARELLE_VERSION,
306
- downloadUrl=MACOS_DOWNLOAD_URL,
335
+ downloadUrl=MACOS_ARM64_DOWNLOAD_URL,
307
336
  )
308
337
  cntlr = _mockCntlrWinMain()
309
338
  version.version = NEW_SEMVER_VERSION
@@ -339,7 +368,7 @@ class TestUpdater:
339
368
  ):
340
369
  arelleRelease = ArelleRelease(
341
370
  version=updateVersion,
342
- downloadUrl=MACOS_DOWNLOAD_URL,
371
+ downloadUrl=MACOS_ARM64_DOWNLOAD_URL,
343
372
  )
344
373
  cntlr = _mockCntlrWinMain()
345
374
  version.version = currentVersion
@@ -361,7 +390,7 @@ class TestUpdater:
361
390
  ):
362
391
  arelleRelease = ArelleRelease(
363
392
  version=NEW_ARELLE_VERSION,
364
- downloadUrl=MACOS_DOWNLOAD_URL,
393
+ downloadUrl=MACOS_ARM64_DOWNLOAD_URL,
365
394
  )
366
395
  cntlr = _mockCntlrWinMain()
367
396
  version.version = "invalid version string"
@@ -378,7 +407,7 @@ class TestUpdater:
378
407
  def test_download(self, showWarning, rename):
379
408
  arelleRelease = ArelleRelease(
380
409
  version=NEW_ARELLE_VERSION,
381
- downloadUrl=MACOS_DOWNLOAD_URL,
410
+ downloadUrl=MACOS_ARM64_DOWNLOAD_URL,
382
411
  )
383
412
  cntlr = _mockCntlrWinMain(
384
413
  tmpDownloadFilename=os.path.normcase("/tmp/path/tmpfile"),
@@ -390,7 +419,7 @@ class TestUpdater:
390
419
  assert not cntlr.uiThreadQueue.empty()
391
420
  assert cntlr.uiThreadQueue.get_nowait() == (
392
421
  Updater._install,
393
- [cntlr, os.path.normcase("/tmp/path/arelle-macos-2.1.3.dmg")],
422
+ [cntlr, os.path.normcase("/tmp/path/arelle-macos-arm64-2.1.3.dmg")],
394
423
  )
395
424
  assert cntlr.uiThreadQueue.empty()
396
425
 
@@ -411,7 +440,7 @@ class TestUpdater:
411
440
  def test_download_failed(self, showWarning, rename):
412
441
  arelleRelease = ArelleRelease(
413
442
  version=NEW_ARELLE_VERSION,
414
- downloadUrl=MACOS_DOWNLOAD_URL,
443
+ downloadUrl=MACOS_ARM64_DOWNLOAD_URL,
415
444
  )
416
445
  cntlr = _mockCntlrWinMain(
417
446
  tmpDownloadFilename=None,
@@ -427,7 +456,7 @@ class TestUpdater:
427
456
  def test_download_process_failed(self, showWarning, rename):
428
457
  arelleRelease = ArelleRelease(
429
458
  version=NEW_ARELLE_VERSION,
430
- downloadUrl=MACOS_DOWNLOAD_URL,
459
+ downloadUrl=MACOS_ARM64_DOWNLOAD_URL,
431
460
  )
432
461
  cntlr = _mockCntlrWinMain()
433
462
  rename.side_effect = OSError()