| 1 |
#!/usr/bin/env python |
| 2 |
|
| 3 |
import os |
| 4 |
import unittest |
| 5 |
|
| 6 |
from mkdocs.commands import new |
| 7 |
from mkdocs.tests.base import change_dir, tempdir |
| 8 |
|
| 9 |
|
| 10 |
class NewTests(unittest.TestCase): |
| 11 |
@tempdir() |
| 12 |
def test_new(self, temp_dir): |
| 13 |
with change_dir(temp_dir): |
| 14 |
new.new("myproject") |
| 15 |
|
| 16 |
expected_paths = [ |
| 17 |
os.path.join(temp_dir, "myproject"), |
| 18 |
os.path.join(temp_dir, "myproject", "mkdocs.yml"), |
| 19 |
os.path.join(temp_dir, "myproject", "docs"), |
| 20 |
os.path.join(temp_dir, "myproject", "docs", "index.md"), |
| 21 |
] |
| 22 |
|
| 23 |
for expected_path in expected_paths: |
| 24 |
self.assertTrue(os.path.exists(expected_path)) |