Skip to content

Commit 564b966

Browse files
committed
Test conf.py default value
1 parent e73480f commit 564b966

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

readthedocs/rtd_tests/tests/test_config_integration.py

+29
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,35 @@ def test_sphinx_builder_default(
613613

614614
get_builder_class.assert_called_with('sphinx')
615615

616+
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.move')
617+
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.append_conf')
618+
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.run')
619+
def test_sphinx_configuration_default(
620+
self, run, append_conf, move, checkout_path, tmpdir):
621+
"""Should be default to find a conf.py file."""
622+
checkout_path.return_value = str(tmpdir)
623+
624+
apply_fs(tmpdir, {'conf.py': ''})
625+
self.create_config_file(tmpdir, {})
626+
self.project.conf_py_file = ''
627+
self.project.save()
628+
629+
update_docs = self.get_update_docs_task()
630+
config = update_docs.config
631+
python_env = Virtualenv(
632+
version=self.version,
633+
build_env=update_docs.build_env,
634+
config=config
635+
)
636+
update_docs.python_env = python_env
637+
638+
update_docs.build_docs_html()
639+
640+
args, kwargs = run.call_args
641+
assert kwargs['cwd'] == str(tmpdir)
642+
append_conf.assert_called_once()
643+
move.assert_called_once()
644+
616645
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.move')
617646
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.append_conf')
618647
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.run')

0 commit comments

Comments
 (0)