This commit is contained in:
1 parent
16019ee649
commit
329b7756f4
17 files changed
+754
-85
No files matched your search
@@ -8,8 +8,12 @@ from pathlib import Path
|
||||
|
||||
def _assert_bootstrap_before(path: str, *late_markers: str) -> None:
|
||||
text = Path(path).read_text(encoding="utf-8")
|
||||
import_marker = "from douyin.updater.bootstrap import run_startup_update_check_early"
|
||||
call_marker = "run_startup_update_check_early("
|
||||
import_marker = (
|
||||
"from douyin.updater.bootstrap import run_startup_update_check_early"
|
||||
if "run_startup_update_check_early(" in text
|
||||
else "from gui.components.update_progress import run_gui_startup_update_check_early"
|
||||
)
|
||||
call_marker = "run_startup_update_check_early(" if "run_startup_update_check_early(" in text else "run_gui_startup_update_check_early("
|
||||
assert import_marker in text
|
||||
assert call_marker in text
|
||||
call_index = text.index(call_marker)
|
||||
@@ -26,9 +30,10 @@ def _assert_packaging_uses_wrapper(wrapper_path: str, target_script: str) -> Non
|
||||
|
||||
def _assert_wrapper_imports_target_after_bootstrap(path: str, target_import: str) -> None:
|
||||
text = Path(path).read_text(encoding="utf-8")
|
||||
assert "run_startup_update_check_early(" in text
|
||||
call_marker = "run_startup_update_check_early(" if "run_startup_update_check_early(" in text else "run_gui_startup_update_check_early("
|
||||
assert call_marker in text
|
||||
assert target_import in text
|
||||
assert text.index("run_startup_update_check_early(") < text.index(target_import)
|
||||
assert text.index(call_marker) < text.index(target_import)
|
||||
|
||||
|
||||
def _assert_source_entry_bootstraps_under_main_guard(path: str, late_marker: str) -> None:
|
||||
|
||||
Reference in new issue
Block a user