Speed up tests!
@@ -64,10 +64,9 @@ class TestCeleryBuilding(RTDTestCase):
self.assertTrue(result.successful())
self.assertFalse(exists(directory))
- @patch('readthedocs.projects.tasks.UpdateDocsTask.build_docs',
- new=MagicMock)
- @patch('readthedocs.projects.tasks.UpdateDocsTask.setup_vcs',
- new=MagicMock)
+ @patch('readthedocs.projects.tasks.UpdateDocsTask.setup_environment', new=MagicMock)
+ @patch('readthedocs.projects.tasks.UpdateDocsTask.build_docs', new=MagicMock)
+ @patch('readthedocs.projects.tasks.UpdateDocsTask.setup_vcs', new=MagicMock)
def test_update_docs(self):
build = get(Build, project=self.project,
version=self.project.versions.first())
@@ -80,8 +79,8 @@ class TestCeleryBuilding(RTDTestCase):
intersphinx=False)
self.assertTrue(result.successful())
- @patch('readthedocs.projects.tasks.UpdateDocsTask.build_docs',
- new=MagicMock)
+ @patch('readthedocs.projects.tasks.UpdateDocsTask.setup_environment', new=MagicMock)
+ @patch('readthedocs.projects.tasks.UpdateDocsTask.build_docs', new=MagicMock)
@patch('readthedocs.projects.tasks.UpdateDocsTask.setup_vcs')
@patch('readthedocs.doc_builder.environments.BuildEnvironment.update_build')
def test_update_docs_unexpected_setup_exception(self, mock_update_build, mock_setup_vcs):
@@ -100,8 +99,8 @@ class TestCeleryBuilding(RTDTestCase):
mock_update_build.assert_called_once_with(state=BUILD_STATE_FINISHED)
@patch('readthedocs.projects.tasks.UpdateDocsTask.build_docs')
- @patch('readthedocs.projects.tasks.UpdateDocsTask.setup_vcs',
- new=MagicMock)
+ @patch('readthedocs.projects.tasks.UpdateDocsTask.setup_environment', new=MagicMock)
+ @patch('readthedocs.projects.tasks.UpdateDocsTask.setup_vcs', new=MagicMock)
@patch('readthedocs.doc_builder.environments.BuildEnvironment.update_build')
def test_update_docs_unexpected_build_exception(self, mock_update_build, mock_build_docs):
exc = Exception()
