File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -77,3 +77,37 @@ def test_project_with_no_commits(tmp_path):
7777 )
7878
7979 os .chdir (cwd )
80+
81+
82+ def test_building_empty_site (tmp_path ):
83+ """
84+ Structure:
85+
86+ tmp_path/testproject
87+ website/
88+ ├── docs/
89+ └── mkdocs.yml"""
90+ testproject_path = tmp_path / "testproject"
91+
92+ shutil .copytree (
93+ "tests/basic_setup/empty_site" , str (testproject_path / "website" / "docs" )
94+ )
95+ shutil .copyfile (
96+ "tests/basic_setup/mkdocs_w_contribution.yml" ,
97+ str (testproject_path / "website" / "mkdocs.yml" ),
98+ )
99+
100+ cwd = os .getcwd ()
101+ os .chdir (str (testproject_path ))
102+
103+ # run 'git init'
104+ gitpython .Repo .init (testproject_path , bare = False )
105+
106+ result = build_docs_setup (
107+ str (testproject_path / "website/mkdocs.yml" ), str (testproject_path / "site" )
108+ )
109+ assert result .exit_code == 0 , (
110+ "'mkdocs build' command failed. Error: %s" % result .stdout
111+ )
112+
113+ os .chdir (cwd )
You can’t perform that action at this time.
0 commit comments