fix(catalog): 打通共享授权扫描与统一来源清单显示
build / build (push) Successful in 1m18s

This commit is contained in:
姚章浩
2026-10-26 18:36:11 +08:00
parent c8f05ee46f
commit e744114ff4
10 changed files with 276 additions and 50 deletions
@@ -3,6 +3,17 @@ import live_catalog_refresh as refresh
class S4ProgressPayloadTests(unittest.TestCase):
def test_source_key_preserves_legacy_directory_identity(self):
from source_catalog_import import stable_connection_id
from unittest.mock import patch
legacy = {'roots': {'company': {'configured_root_id': 'root'}}}
with patch.object(refresh.pathlib.Path, 'read_text', return_value=json.dumps(legacy)):
self.assertEqual(refresh.dingtalk_root_key(stable_connection_id('dingtalk-company'), 'space'), 'company')
self.assertEqual(refresh.dingtalk_root_key(stable_connection_id('dingtalk-space-space'), 'space'), 'space-space')
with patch.object(refresh.pathlib.Path, 'read_text', return_value=json.dumps(legacy)):
with self.assertRaises(RuntimeError):
refresh.dingtalk_root_key('sc-unrecognized', 'space')
def collect(self, fn):
buffer=io.StringIO()
with contextlib.redirect_stdout(buffer):