Skip to content

Commit ba477b3

Browse files
committed
Add yaml test
1 parent bafced3 commit ba477b3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

readthedocs/rtd_tests/tests/test_builds.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,31 @@ def test_build_respects_epub_flag(self):
103103
# PDF however was disabled and therefore not built.
104104
self.assertFalse(self.mocks.pdf_build.called)
105105

106+
def test_build_respects_yaml(self):
107+
'''Test build with epub enabled'''
108+
project = get(Project,
109+
slug='project-1',
110+
documentation_type='sphinx',
111+
conf_py_file='test_conf.py',
112+
enable_pdf_build=False,
113+
enable_epub_build=False,
114+
versions=[fixture()])
115+
version = project.versions.all()[0]
116+
117+
build_env = LocalEnvironment(project=project, version=version, build={})
118+
python_env = Virtualenv(version=version, build_env=build_env)
119+
yaml_config = get_build_config({'formats': ['epub']})
120+
config = ConfigWrapper(version=version, yaml_config=yaml_config)
121+
task = UpdateDocsTask(build_env=build_env, project=project, python_env=python_env,
122+
version=version, search=False, localmedia=False, config=config)
123+
task.build_docs()
124+
125+
# The HTML and the Epub format were built.
126+
self.mocks.html_build.assert_called_once_with()
127+
self.mocks.epub_build.assert_called_once_with()
128+
# PDF however was disabled and therefore not built.
129+
self.assertFalse(self.mocks.pdf_build.called)
130+
106131
def test_builder_comments(self):
107132
'''Normal build with comments'''
108133
project = get(Project,

0 commit comments

Comments
 (0)