@@ -46,7 +46,7 @@ def test_sync_files_pdf(self, rmtree, copy):
46
46
args , _ = rmtree .call_args
47
47
self .assertIn ('epub' , args [0 ])
48
48
49
- # Artifacts are copied to the rtd-builds directory
49
+ # Artifacts are copied to the media directory
50
50
copy .assert_called_once ()
51
51
args , _ = copy .call_args
52
52
self .assertIn ('artifacts' , args [0 ])
@@ -65,7 +65,7 @@ def test_sync_files_epub(self, rmtree, copy):
65
65
args , _ = rmtree .call_args
66
66
self .assertIn ('pdf' , args [0 ])
67
67
68
- # Artifacts are copied to the rtd-builds directory
68
+ # Artifacts are copied to the media directory
69
69
copy .assert_called_once ()
70
70
args , _ = copy .call_args
71
71
self .assertIn ('artifacts' , args [0 ])
@@ -86,9 +86,30 @@ def test_sync_files_localmedia(self, rmtree, copy):
86
86
args , _ = epub
87
87
self .assertIn ('epub' , args [0 ])
88
88
89
- # Artifacts are copied to the rtd-builds directory
89
+ # Artifacts are copied to the media directory
90
90
copy .assert_called_once ()
91
91
args , _ = copy .call_args
92
92
self .assertIn ('artifacts' , args [0 ])
93
93
self .assertIn ('sphinx_localmedia' , args [0 ])
94
94
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