|
5 | 5 | unicode_literals,
|
6 | 6 | )
|
7 | 7 |
|
8 |
| -import mock |
9 | 8 | import os
|
| 9 | + |
| 10 | +import mock |
10 | 11 | from django.test import TestCase
|
11 | 12 | from django_dynamic_fixture import fixture, get
|
12 | 13 |
|
13 | 14 | from readthedocs.builds.models import Build, Version
|
14 |
| -from readthedocs.doc_builder.config import load_yaml_config |
15 | 15 | from readthedocs.doc_builder.backends.mkdocs import MkdocsHTML
|
16 | 16 | from readthedocs.doc_builder.backends.sphinx import HtmlBuilder as SphinxHTML
|
| 17 | +from readthedocs.doc_builder.config import load_yaml_config |
17 | 18 | from readthedocs.doc_builder.environments import LocalBuildEnvironment
|
18 | 19 | from readthedocs.doc_builder.python_environments import Virtualenv
|
19 |
| -from readthedocs.projects.models import Project, EnvironmentVariable |
20 |
| -from readthedocs.rtd_tests.tests.test_config_integration import create_load |
| 20 | +from readthedocs.projects.models import EnvironmentVariable, Project |
| 21 | +from readthedocs.projects.tasks import UpdateDocsTaskStep |
21 | 22 | from readthedocs.rtd_tests.mocks.paths import fake_paths_by_endswith
|
| 23 | +from readthedocs.rtd_tests.tests.test_config_integration import create_load |
22 | 24 |
|
23 | 25 | from ..mocks.environment import EnvironmentMockGroup
|
24 | 26 |
|
@@ -61,7 +63,9 @@ def test_build(self, load_config):
|
61 | 63 | self.assertRegexpMatches(cmd[0][0], r'python')
|
62 | 64 | self.assertRegexpMatches(cmd[0][1], r'sphinx-build')
|
63 | 65 |
|
64 |
| - def test_build_generate_index_file_force(self): |
| 66 | + @mock.patch('readthedocs.doc_builder.config.load_config') |
| 67 | + def test_build_generate_index_file_force(self, load_config): |
| 68 | + load_config.side_effect = create_load() |
65 | 69 | project = get(
|
66 | 70 | Project,
|
67 | 71 | slug='project-1',
|
@@ -92,7 +96,9 @@ def test_build_generate_index_file_force(self):
|
92 | 96 | )
|
93 | 97 | self.assertEqual(result, 'index')
|
94 | 98 |
|
95 |
| - def test_build_get_index_file_force(self): |
| 99 | + @mock.patch('readthedocs.doc_builder.config.load_config') |
| 100 | + def test_build_get_index_file_force(self, load_config): |
| 101 | + load_config.side_effect = create_load() |
96 | 102 | project = get(
|
97 | 103 | Project,
|
98 | 104 | slug='project-1',
|
@@ -121,7 +127,9 @@ def test_build_get_index_file_force(self):
|
121 | 127 | self.assertEqual(len(mock_open.mock_calls), 0)
|
122 | 128 | self.assertEqual(result, 'index')
|
123 | 129 |
|
124 |
| - def test_build_generate_index_file(self): |
| 130 | + @mock.patch('readthedocs.doc_builder.config.load_config') |
| 131 | + def test_build_generate_index_file(self, load_config): |
| 132 | + load_config.side_effect = create_load() |
125 | 133 | project = get(
|
126 | 134 | Project,
|
127 | 135 | slug='project-1',
|
@@ -152,7 +160,9 @@ def test_build_generate_index_file(self):
|
152 | 160 | )
|
153 | 161 | self.assertEqual(result, 'index')
|
154 | 162 |
|
155 |
| - def test_get_readme_file(self): |
| 163 | + @mock.patch('readthedocs.doc_builder.config.load_config') |
| 164 | + def test_get_readme_file(self, load_config): |
| 165 | + load_config.side_effect = create_load() |
156 | 166 | project = get(
|
157 | 167 | Project,
|
158 | 168 | slug='project-1',
|
@@ -181,7 +191,9 @@ def test_get_readme_file(self):
|
181 | 191 | self.assertEqual(len(mock_open.mock_calls), 0)
|
182 | 192 | self.assertEqual(result, 'README')
|
183 | 193 |
|
184 |
| - def test_get_index_file(self): |
| 194 | + @mock.patch('readthedocs.doc_builder.config.load_config') |
| 195 | + def test_get_index_file(self, load_config): |
| 196 | + load_config.side_effect = create_load() |
185 | 197 | project = get(
|
186 | 198 | Project,
|
187 | 199 | slug='project-1',
|
|
0 commit comments