def test_cli_register_verbose(self, mock_config: Mock, run_config: CliObjectRunner): run_config.invoke(cli.main, ['-V', ':register', 'test']) mock_config.load.assert_called_once_with() mock_config.set_verbose.assert_called_once_with() mock_config.register.assert_not_called()
def test_cli_search_path(self, mock_config: Mock, run_config: CliObjectRunner): run_config.invoke(cli.main, ['-S', 'Test', 'test']) mock_config.set_verbose.assert_not_called() mock_config.search_path.assert_called_once_with('Test') mock_config.load.assert_called_once_with()
def test_cli_register_package(self, mock_config: Mock, run_config: CliObjectRunner): run_config.invoke(cli.main, [':register', 'test', 'package']) mock_config.load.assert_called_once_with() mock_config.register.assert_called_once_with('test', ('package', ), config_path=None, venv_path=None)
def test_cli_create(self, mock_config: Mock, run_config: CliObjectRunner): run_config.invoke(cli.main, [':create']) mock_config.load.assert_called_once_with() mock_config.create.assert_not_called()
def test_cli_create_update(self, mock_config: Mock, run_config: CliObjectRunner): run_config.invoke(cli.main, [':create', 'test', '-U']) mock_config.load.assert_called_once_with() mock_config.create.assert_called_once_with('test', clean=False, update=True)
def test_cli_list_help(self, run_config: CliObjectRunner) -> None: result = run_config.invoke(cli.main, [':list', '--help']) assert result.exit_code == 0 assert 'Show this message and exit.' in result.output
def test_cli_version(self, run_config: CliObjectRunner): result = run_config.invoke(cli.main, ['--version']) assert result.exit_code == 0 assert 'sv, version' in result.output
def test_cli_default(self, run_config: CliObjectRunner): result = run_config.invoke(cli.main) assert result.exit_code == 0 assert 'Show this message and exit.' in result.output
def test_cli_register(self, mock_config: Mock, run_config: CliObjectRunner): run_config.invoke(cli.main, [':register']) mock_config.load.assert_called_once_with() mock_config.register.assert_not_called()