feat: add declarative sing-box egress control plane
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import io
|
||||
import unittest
|
||||
|
||||
from vpn_egressctl.cli import _parser
|
||||
|
||||
|
||||
class CliTests(unittest.TestCase):
|
||||
def test_uri_positional_argument_is_rejected(self) -> None:
|
||||
with contextlib.redirect_stderr(io.StringIO()), self.assertRaises(SystemExit):
|
||||
_parser().parse_args(["import", "hysteria2://secret@example.com"])
|
||||
|
||||
def test_render_requires_output(self) -> None:
|
||||
with contextlib.redirect_stderr(io.StringIO()), self.assertRaises(SystemExit):
|
||||
_parser().parse_args(["render"])
|
||||
|
||||
def test_all_commands_parse(self) -> None:
|
||||
for command in ("check", "diff", "sync", "status", "doctor", "rollback"):
|
||||
with self.subTest(command=command):
|
||||
args = _parser().parse_args([command])
|
||||
self.assertEqual(args.command, command)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user