Skip to content

Commit 93d3e63

Browse files
committed
One more test
1 parent 44f9f9c commit 93d3e63

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

readthedocs/rtd_tests/tests/test_projects_tasks.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_sync_files_pdf(self, rmtree, copy):
4646
args, _ = rmtree.call_args
4747
self.assertIn('epub', args[0])
4848

49-
# Artifacts are copied to the rtd-builds directory
49+
# Artifacts are copied to the media directory
5050
copy.assert_called_once()
5151
args, _ = copy.call_args
5252
self.assertIn('artifacts', args[0])
@@ -65,7 +65,7 @@ def test_sync_files_epub(self, rmtree, copy):
6565
args, _ = rmtree.call_args
6666
self.assertIn('pdf', args[0])
6767

68-
# Artifacts are copied to the rtd-builds directory
68+
# Artifacts are copied to the media directory
6969
copy.assert_called_once()
7070
args, _ = copy.call_args
7171
self.assertIn('artifacts', args[0])
@@ -86,9 +86,30 @@ def test_sync_files_localmedia(self, rmtree, copy):
8686
args, _ = epub
8787
self.assertIn('epub', args[0])
8888

89-
# Artifacts are copied to the rtd-builds directory
89+
# Artifacts are copied to the media directory
9090
copy.assert_called_once()
9191
args, _ = copy.call_args
9292
self.assertIn('artifacts', args[0])
9393
self.assertIn('sphinx_localmedia', args[0])
9494
self.assertIn('media/htmlzip', args[1])
95+
96+
@patch('readthedocs.builds.syncers.Syncer.copy')
97+
@patch('readthedocs.projects.tasks.shutil.rmtree')
98+
def test_sync_files_search(self, rmtree, copy):
99+
sync_files(
100+
self.project.pk, self.version.pk, 'sphinx', search=True
101+
)
102+
pdf, epub = rmtree.call_args_list
103+
104+
# pdf and epub are cleaned
105+
args, _ = pdf
106+
self.assertIn('pdf', args[0])
107+
args, _ = epub
108+
self.assertIn('epub', args[0])
109+
110+
# Artifacts are copied to the media directory
111+
copy.assert_called_once()
112+
args, _ = copy.call_args
113+
self.assertIn('artifacts', args[0])
114+
self.assertIn('sphinx_search', args[0])
115+
self.assertIn('media/json', args[1])

0 commit comments

Comments
 (0)