35 lines
1.9 KiB
Python
35 lines
1.9 KiB
Python
"""Read-only verification of the scoped Unity CLI Loop migration."""
|
|
import json
|
|
from pathlib import Path
|
|
|
|
root=Path(__file__).resolve().parents[2]
|
|
client=root/'Client'
|
|
output=Path(__file__).parent
|
|
pkg=client/'Packages/io.github.hatayama.uloopmcp'
|
|
read=lambda p:json.loads(p.read_text(encoding='utf-8-sig'))
|
|
manifest=read(client/'Packages/manifest.json')
|
|
before=read(output/'manifest-before-uloop.json')
|
|
lock=read(client/'Packages/packages-lock.json')['dependencies']
|
|
oldlock=read(output/'packages-lock-before-uloop.json')['dependencies']
|
|
key='io.github.hatayama.uloopmcp'; old='com.besty.unity-skills'
|
|
assert read(pkg/'package.json')['version']=='2.2.0'
|
|
assert manifest['dependencies'][key]=='file:Packages/io.github.hatayama.uloopmcp'
|
|
assert old not in manifest['dependencies'] and old not in lock
|
|
assert lock[key]['depth']==0
|
|
assert 'com.unity.inputsystem' not in manifest['dependencies']
|
|
expected=json.loads(json.dumps(before))
|
|
del expected['dependencies'][old]
|
|
expected['dependencies'][key]='file:Packages/io.github.hatayama.uloopmcp'
|
|
assert manifest==expected, 'Unexpected manifest changes'
|
|
changed=[k for k in set(lock)|set(oldlock) if lock.get(k)!=oldlock.get(k)]
|
|
assert set(changed)=={key,old},changed
|
|
assert '/Client/.uloop/' in (root/'.gitignore').read_text()
|
|
assert 'm_EditorVersion: 2022.3.62f2c1' in (client/'ProjectSettings/ProjectVersion.txt').read_text()
|
|
for f in ['Editor/Server/McpServerController.cs','Editor/Core/ApplicationServices/DomainReloadDetectionService.cs']:
|
|
source=(pkg/f).read_text(encoding='utf-8-sig')
|
|
assert 'Application.isBatchMode' in source and 'AssetDatabase.IsAssetImportWorkerProcess()' in source
|
|
assert (pkg/'FT_PATCHES.md').exists()
|
|
result={'passed':True,'package':key,'version':'2.2.0','lockChangedKeys':sorted(changed),'inputSystemAdded':False}
|
|
(output/'uloop-static-verification.json').write_text(json.dumps(result,indent=2),encoding='utf-8')
|
|
print(json.dumps(result))
|