This commit is contained in:
@@ -16,6 +16,7 @@ sys.path.insert(0, str(ROOT / "scripts"))
|
||||
from gen_clash_verge_script import ( # noqa: E402
|
||||
default_output_path,
|
||||
load_payload,
|
||||
render_script,
|
||||
to_rule,
|
||||
)
|
||||
|
||||
@@ -193,6 +194,23 @@ class ModuleSpecTests(unittest.TestCase):
|
||||
)
|
||||
self.assertTrue(all(",DIRECT" not in entry for entry in payload))
|
||||
|
||||
def test_onedrive_process_is_forced_to_use_direct_routing(self) -> None:
|
||||
payload = load_payload(ROOT / "direct.yaml")
|
||||
|
||||
self.assertIn("PROCESS-NAME,OneDrive.exe", payload)
|
||||
self.assertEqual(
|
||||
to_rule("PROCESS-NAME,OneDrive.exe"),
|
||||
"PROCESS-NAME,OneDrive.exe,DIRECT",
|
||||
)
|
||||
|
||||
def test_clash_verge_script_adds_reachable_direct_dns_fallbacks(self) -> None:
|
||||
script = render_script(["PROCESS-NAME,OneDrive.exe"])
|
||||
|
||||
self.assertIn("const directDnsFallbacks", script)
|
||||
self.assertIn("https://dns.alidns.com/dns-query", script)
|
||||
self.assertIn("https://doh.pub/dns-query", script)
|
||||
self.assertIn("config.dns = dns", script)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user