Improve code spacing

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2026-10-13 19:55:55 +08:00
parent e4069d04da
commit 7eebeef4f0
12 changed files with 42 additions and 0 deletions
+5
View File
@@ -103,6 +103,7 @@ class SingTUNLinuxHostTest(unittest.TestCase):
Path(arguments[2]).parent.joinpath('ready').write_text(
'77', encoding='utf-8'
)
return process
link = {'ifname': 'utun101', 'ifindex': 77}
@@ -117,8 +118,10 @@ class SingTUNLinuxHostTest(unittest.TestCase):
self.module, '_command', return_value=json.dumps([link])
):
self.host.prepare()
with self.assertRaisesRegex(RuntimeError, 'already active'):
self.host.execute([])
self.host.applyDNS('1.1.1.1')
self.assertEqual(self.host.index, 77)
@@ -135,6 +138,7 @@ class SingTUNLinuxHostTest(unittest.TestCase):
self.assertIn('/sys/class/net/utun101/ifindex', scripts[0])
self.assertIn('resolvectl dns utun101 1.1.1.1', scripts[0])
self.assertNotIn('socks5', ''.join(scripts))
self.assertIs(self.host._process, process)
self.assertIsNotNone(self.host._directory)
@@ -157,6 +161,7 @@ class SingTUNLinuxHostTest(unittest.TestCase):
checked = subprocess.run(
[bash, '-n', '-c', script], capture_output=True, timeout=5
)
self.assertEqual(
checked.returncode, 0, checked.stderr.decode(errors='replace')
)