@@ -103,6 +103,31 @@ def test_build_respects_epub_flag(self):
103
103
# PDF however was disabled and therefore not built.
104
104
self .assertFalse (self .mocks .pdf_build .called )
105
105
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
+
106
131
def test_builder_comments (self ):
107
132
'''Normal build with comments'''
108
133
project = get (Project ,
0 commit comments