883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
21 lines
1.4 KiB
Python
21 lines
1.4 KiB
Python
import sys,tempfile,unittest
|
|
from pathlib import Path
|
|
sys.path.insert(0,str(Path(__file__).resolve().parents[1]/'ops'))
|
|
from windows_client_package import copy_public_client
|
|
from linux_client_package import PRODUCT_FILES,DATA_TREES,GAME_FILES,GAME_TREES
|
|
class PublicPackage(unittest.TestCase):
|
|
def test_reuses_content_allowlist_and_excludes_account_logs_and_cache(self):
|
|
with tempfile.TemporaryDirectory()as folder:
|
|
source=Path(folder)/'source';source.mkdir();game=source/'_classic_beta_';game.mkdir()
|
|
for name in PRODUCT_FILES:(source/name).write_bytes(b'product')
|
|
for name in GAME_FILES:(game/name).write_bytes(b'game')
|
|
for tree in [*(source/'Data'/name for name in DATA_TREES),*(game/name for name in GAME_TREES)]:tree.mkdir(parents=True);(tree/'asset').write_bytes(b'content')
|
|
for name in ['WTF/Account','Logs','Cache','Errors']:
|
|
p=game/name;p.mkdir(parents=True,exist_ok=True);(p/'private').write_bytes(b'private fixture')
|
|
(game/'WTF/Config.wtf').write_text('SET accountName "private fixture"\nSET gxWindowedResolution "1280x800"\n')
|
|
output=Path(folder)/'output';copy_public_client(source,output)
|
|
for name in ['WTF/Account','Logs','Cache','Errors']:self.assertFalse((output/'_classic_beta_'/name).exists())
|
|
self.assertNotIn('private fixture',(output/'_classic_beta_/WTF/Config.wtf').read_text())
|
|
self.assertEqual((output/'Data/data/asset').read_bytes(),b'content')
|
|
if __name__=='__main__':unittest.main()
|