"""Windows 更新凭据按服务器隔离的测试。""" import unittest from src.windows_credential_store import WindowsCredentialStore class WindowsCredentialStoreTest(unittest.TestCase): def test_different_origins_use_different_credential_targets(self): http_store = WindowsCredentialStore.for_url( "http://cm.xiapi.com/autobuy——manifest.json" ) https_store = WindowsCredentialStore.for_url( "https://cm.xiapi.com/autobuy——manifest.json" ) other_store = WindowsCredentialStore.for_url( "https://updates.example.test/manifest.json" ) self.assertNotEqual(http_store.target, https_store.target) self.assertNotEqual(https_store.target, other_store.target) self.assertNotIn("@", http_store.target) if __name__ == "__main__": unittest.main()