feat: store packaged user data under data directory
This commit is contained in:
@@ -7,12 +7,14 @@ class PackagingTests(unittest.TestCase):
|
||||
def read_text(self, relative_path):
|
||||
return (REPO_ROOT / relative_path).read_text(encoding="utf-8")
|
||||
|
||||
def test_frozen_entrypoint_uses_exe_directory(self):
|
||||
def test_frozen_entrypoint_keeps_program_and_data_paths_separate(self):
|
||||
main_py = self.read_text("main.py")
|
||||
gui_init = self.read_text("app/gui/__init__.py")
|
||||
|
||||
self.assertIn('getattr(sys, "frozen", False)', main_py)
|
||||
self.assertIn("sys.executable", main_py)
|
||||
self.assertIn("os.chdir(PROJECT_ROOT)", main_py)
|
||||
self.assertNotIn("os.chdir(PROJECT_ROOT)", main_py)
|
||||
self.assertIn("appconfig.prepare_data_dir()", gui_init)
|
||||
|
||||
def test_pyinstaller_spec_uses_onedir_without_local_datas(self):
|
||||
spec = self.read_text("cmshopee.spec")
|
||||
@@ -37,6 +39,7 @@ class PackagingTests(unittest.TestCase):
|
||||
"logs",
|
||||
"prompts",
|
||||
"title_prompt.txt",
|
||||
"data",
|
||||
):
|
||||
self.assertIn(token, script)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user