File tree Expand file tree Collapse file tree 1 file changed +20
-22
lines changed
readthedocs/projects/tests Expand file tree Collapse file tree 1 file changed +20
-22
lines changed Original file line number Diff line number Diff line change @@ -301,15 +301,9 @@ def test_build_updates_documentation_type(self, load_yaml_config):
301
301
self ._trigger_update_docs_task ()
302
302
303
303
# Update version state
304
- patch_request = None
305
- for req in self .requests_mock .request_history [7 :]:
306
- if req ._request .method == "PATCH" and req .path == "/api/v2/version/1/" :
307
- patch_request = req
308
- break
309
-
310
- assert patch_request ._request .method == "PATCH"
311
- assert patch_request .path == "/api/v2/version/1/"
312
- assert patch_request .json () == {
304
+ assert self .requests_mock .request_history [8 ]._request .method == "PATCH"
305
+ assert self .requests_mock .request_history [8 ].path == "/api/v2/version/1/"
306
+ assert self .requests_mock .request_history [8 ].json () == {
313
307
"addons" : False ,
314
308
"build_data" : None ,
315
309
"built" : True ,
@@ -2012,19 +2006,23 @@ def test_mkdocs_fail_on_warning(self, load_yaml_config):
2012
2006
2013
2007
self ._trigger_update_docs_task ()
2014
2008
2015
- self .mocker .mocks ["environment.run" ].assert_any_call (
2016
- mock .ANY ,
2017
- "-m" ,
2018
- "mkdocs" ,
2019
- "build" ,
2020
- "--clean" ,
2021
- "--site-dir" ,
2022
- "$READTHEDOCS_OUTPUT/html" ,
2023
- "--config-file" ,
2024
- "docs/mkdocs.yaml" ,
2025
- "--strict" ,
2026
- cwd = mock .ANY ,
2027
- bin_path = mock .ANY ,
2009
+ self .mocker .mocks ["environment.run" ].assert_has_calls (
2010
+ [
2011
+ mock .call (
2012
+ mock .ANY ,
2013
+ "-m" ,
2014
+ "mkdocs" ,
2015
+ "build" ,
2016
+ "--clean" ,
2017
+ "--site-dir" ,
2018
+ "$READTHEDOCS_OUTPUT/html" ,
2019
+ "--config-file" ,
2020
+ "docs/mkdocs.yaml" ,
2021
+ "--strict" , # fail on warning flag
2022
+ cwd = mock .ANY ,
2023
+ bin_path = mock .ANY ,
2024
+ )
2025
+ ]
2028
2026
)
2029
2027
2030
2028
@mock .patch ("readthedocs.doc_builder.director.load_yaml_config" )
You can’t perform that action at this time.
0 commit comments