mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
24 lines
601 B
Python
24 lines
601 B
Python
import unittest
|
|
from unittest.mock import MagicMock, patch
|
|
|
|
from fastdeploy.entrypoints.cli.main import main as cli_main
|
|
|
|
|
|
class TestCliMain(unittest.TestCase):
|
|
@patch("fastdeploy.utils.FlexibleArgumentParser")
|
|
def test_main_basic(self, mock_parser):
|
|
# Setup mocks
|
|
mock_args = MagicMock()
|
|
mock_args.subparser = None
|
|
mock_parser.return_value.parse_args.return_value = mock_args
|
|
|
|
# Test basic call
|
|
cli_main()
|
|
|
|
# Verify version check
|
|
mock_args.dispatch_function.assert_called_once()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|