# Path: mkdocs/commands/new.py
# def new(output_dir):
# 
#     docs_dir = os.path.join(output_dir, 'docs')
#     config_path = os.path.join(output_dir, 'mkdocs.yml')
#     index_path = os.path.join(docs_dir, 'index.md')
# 
#     if os.path.exists(config_path):
#         log.info('Project already exists.')
#         return
# 
#     if not os.path.exists(output_dir):
#         log.info(f'Creating project directory: {output_dir}')
#         os.mkdir(output_dir)
# 
#     log.info(f'Writing config file: {config_path}')
#     with open(config_path, 'w', encoding='utf-8') as f:
#         f.write(config_text)
# 
#     if os.path.exists(index_path):
#         return
# 
#     log.info(f'Writing initial docs: {index_path}')
#     if not os.path.exists(docs_dir):
#         os.mkdir(docs_dir)
#     with open(index_path, 'w', encoding='utf-8') as f:
#         f.write(index_text)


import tempfile
import unittest
import os
from mkdocs.commands import new
#!/usr/bin/env python




class NewTests(unittest.TestCase):

    def test_new(self):

        tempdir = tempfile.mkdtemp()
        os.chdir(tempdir)


# Path: mkdocs/commands/new.py
# def new(output_dir):
# 
#     docs_dir = os.path.join(output_dir, 'docs')
#     config_path = os.path.join(output_dir, 'mkdocs.yml')
#     index_path = os.path.join(docs_dir, 'index.md')
# 
#     if os.path.exists(config_path):
#         log.info('Project already exists.')
#         return
# 
#     if not os.path.exists(output_dir):
#         log.info(f'Creating project directory: {output_dir}')
#         os.mkdir(output_dir)
# 
#     log.info(f'Writing config file: {config_path}')
#     with open(config_path, 'w', encoding='utf-8') as f:
#         f.write(config_text)
# 
#     if os.path.exists(index_path):
#         return
# 
#     log.info(f'Writing initial docs: {index_path}')
#     if not os.path.exists(docs_dir):
#         os.mkdir(docs_dir)
#     with open(index_path, 'w', encoding='utf-8') as f:
#         f.write(index_text)


# Path: mkdocs/tests/new_tests.py
import tempfile
import unittest
import os
from mkdocs.commands import new

#!/usr/bin/env python




class NewTests(unittest.TestCase):

    def test_new(self):

        tempdir = tempfile.mkdtemp()
        os.chdir(tempdir)


        new.new("myproject")