19 lines
678 B
Python
19 lines
678 B
Python
import pytest
|
|
from unittest.mock import patch, MagicMock
|
|
import cli
|
|
import sys
|
|
|
|
def test_arg_parsing_default():
|
|
"""Test that default arguments are parsed correctly."""
|
|
with patch.object(sys, 'argv', ['cli.py']):
|
|
args = cli.parse_args()
|
|
assert args.consul_url is None # Should use config default later
|
|
assert args.no_color is False
|
|
|
|
def test_arg_parsing_custom():
|
|
"""Test that custom arguments are parsed correctly."""
|
|
with patch.object(sys, 'argv', ['cli.py', '--consul-url', 'http://custom:8500', '--no-color']):
|
|
args = cli.parse_args()
|
|
assert args.consul_url == 'http://custom:8500'
|
|
assert args.no_color is True
|