Skip to content

Commit 29faa46

Browse files
committed
Add test
1 parent fbafd02 commit 29faa46

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

readthedocs/rtd_tests/tests/test_doc_builder.py

+28
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,31 @@ def test_dont_override_theme(self, checkout_path, run):
335335
config['theme_dir'],
336336
'not-readthedocs'
337337
)
338+
339+
@patch('readthedocs.doc_builder.backends.mkdocs.BaseMkdocs.generate_rtd_data')
340+
@patch('readthedocs.doc_builder.base.BaseBuilder.run')
341+
@patch('readthedocs.projects.models.Project.checkout_path')
342+
def test_write_js_data_docs_dir(self, checkout_path, run, generate_rtd_data):
343+
tmpdir = tempfile.mkdtemp()
344+
os.mkdir(os.path.join(tmpdir, 'docs'))
345+
yaml_file = os.path.join(tmpdir, 'mkdocs.yml')
346+
yaml.safe_dump(
347+
{
348+
'site_name': 'mkdocs',
349+
'docs_dir': 'docs',
350+
},
351+
open(yaml_file, 'w')
352+
)
353+
checkout_path.return_value = tmpdir
354+
generate_rtd_data.return_value = ''
355+
356+
self.searchbuilder = MkdocsHTML(
357+
build_env=self.build_env,
358+
python_env=None
359+
)
360+
self.searchbuilder.append_conf()
361+
362+
generate_rtd_data.assert_called_with(
363+
docs_dir='docs',
364+
mkdocs_config=mock.ANY
365+
)

0 commit comments

Comments
 (0)