# Path: mkdocs/__main__.py
# class ColorFormatter(logging.Formatter):
# class State:
#     def format(self, record):
#     def __init__(self, log_name='mkdocs', level=logging.INFO):
# def add_options(opts):
#     def inner(f):
# def verbose_option(f):
#     def callback(ctx, param, value):
# def quiet_option(f):
#     def callback(ctx, param, value):
# def cli():
# def serve_command(dev_addr, livereload, watch, **kwargs):
# def build_command(clean, **kwargs):
# def gh_deploy_command(clean, message, remote_branch, remote_name, force, ignore_version, shell, **kwargs):
# def new_command(project_directory):
# PYTHON_VERSION = f"{sys.version_info.major}.{sys.version_info.minor}"
# PKG_DIR = os.path.dirname(os.path.abspath(__file__))


import unittest
import logging
import io
from unittest import mock
from click.testing import CliRunner
from mkdocs import __main__ as cli

        self.assertEqual(result.exit_code, 0)
        self.assertEqual(mock_serve.call_count, 1)
        args, kwargs = mock_serve.call_args
        self.assertTrue('config_file' in kwargs)
        self.assertIsInstance(kwargs['config_file'], io.BufferedReader)
        self.assertEqual(kwargs['config_file'].name, 'mkdocs.yml')

    @mock.patch('mkdocs.commands.serve.serve', autospec=True)
    def test_serve_dev_addr(self, mock_serve):

        result = self.runner.invoke(
            cli.cli, ["serve", '--dev-addr', '0.0.0.0:80'], catch_exceptions=False)

        self.assertEqual(result.exit_code, 0)
        mock_serve.assert_called_once_with(
            dev_addr='0.0.0.0:80',
            livereload='livereload',
            config_file=None,
            strict=None,
            theme=None,
            use_directory_urls=None,
            watch_theme=False,
            watch=()
        )

    @mock.patch('mkdocs.commands.serve.serve', autospec=True)
    def test_serve_strict(self, mock_serve):

        result = self.runner.invoke(

# Path: mkdocs/__main__.py
# class ColorFormatter(logging.Formatter):
# class State:
#     def format(self, record):
#     def __init__(self, log_name='mkdocs', level=logging.INFO):
# def add_options(opts):
#     def inner(f):
# def verbose_option(f):
#     def callback(ctx, param, value):
# def quiet_option(f):
#     def callback(ctx, param, value):
# def cli():
# def serve_command(dev_addr, livereload, watch, **kwargs):
# def build_command(clean, **kwargs):
# def gh_deploy_command(clean, message, remote_branch, remote_name, force, ignore_version, shell, **kwargs):
# def new_command(project_directory):
# PYTHON_VERSION = f"{sys.version_info.major}.{sys.version_info.minor}"
# PKG_DIR = os.path.dirname(os.path.abspath(__file__))


# Path: mkdocs/tests/cli_tests.py
import unittest
import logging
import io
from unittest import mock
from click.testing import CliRunner
from mkdocs import __main__ as cli


        self.assertEqual(result.exit_code, 0)
        self.assertEqual(mock_serve.call_count, 1)
        args, kwargs = mock_serve.call_args
        self.assertTrue('config_file' in kwargs)
        self.assertIsInstance(kwargs['config_file'], io.BufferedReader)
        self.assertEqual(kwargs['config_file'].name, 'mkdocs.yml')

    @mock.patch('mkdocs.commands.serve.serve', autospec=True)
    def test_serve_dev_addr(self, mock_serve):

        result = self.runner.invoke(
            cli.cli, ["serve", '--dev-addr', '0.0.0.0:80'], catch_exceptions=False)

        self.assertEqual(result.exit_code, 0)
        mock_serve.assert_called_once_with(
            dev_addr='0.0.0.0:80',
            livereload='livereload',
            config_file=None,
            strict=None,
            theme=None,
            use_directory_urls=None,
            watch_theme=False,
            watch=()
        )

    @mock.patch('mkdocs.commands.serve.serve', autospec=True)
    def test_serve_strict(self, mock_serve):

        result = self.runner.invoke(

            cli.cli, ["serve", '--strict'], catch_exceptions=False)