|
21 | 21 | from readthedocs.rtd_tests.utils import make_test_git
|
22 | 22 | from readthedocs.rtd_tests.base import RTDTestCase
|
23 | 23 | from readthedocs.rtd_tests.mocks.mock_api import mock_api
|
| 24 | +from readthedocs.doc_builder.exceptions import VersionLockedError |
24 | 25 |
|
25 | 26 |
|
26 | 27 | class TestCeleryBuilding(RTDTestCase):
|
@@ -117,6 +118,25 @@ def test_update_docs_unexpected_build_exception(self, mock_build_docs):
|
117 | 118 | intersphinx=False)
|
118 | 119 | self.assertTrue(result.successful())
|
119 | 120 |
|
| 121 | + @patch('readthedocs.projects.tasks.UpdateDocsTaskStep.setup_python_environment', new=MagicMock) |
| 122 | + @patch('readthedocs.projects.tasks.UpdateDocsTaskStep.build_docs', new=MagicMock) |
| 123 | + @patch('readthedocs.projects.tasks.UpdateDocsTaskStep.send_notifications') |
| 124 | + @patch('readthedocs.projects.tasks.UpdateDocsTaskStep.setup_vcs') |
| 125 | + def test_no_notification_on_version_locked_error(self, mock_setup_vcs, mock_send_notifications): |
| 126 | + mock_setup_vcs.side_effect = VersionLockedError() |
| 127 | + |
| 128 | + build = get(Build, project=self.project, |
| 129 | + version=self.project.versions.first()) |
| 130 | + with mock_api(self.repo) as mapi: |
| 131 | + result = tasks.update_docs_task.delay( |
| 132 | + self.project.pk, |
| 133 | + build_pk=build.pk, |
| 134 | + record=False, |
| 135 | + intersphinx=False) |
| 136 | + |
| 137 | + mock_send_notifications.assert_not_called() |
| 138 | + self.assertTrue(result.successful()) |
| 139 | + |
120 | 140 | def test_sync_repository(self):
|
121 | 141 | version = self.project.versions.get(slug=LATEST)
|
122 | 142 | with mock_api(self.repo):
|
|
0 commit comments