|
199 | 199 |
|
200 | 200 | (ert-deftest jupyter-delete-directory () |
201 | 201 | :tags '(tramp server) |
202 | | - (jupyter-test-at-temporary-directory |
203 | | - (let* ((tfile (make-temp-file "delete-directory")) |
204 | | - (tdir (make-temp-file "delete-directory" 'directory)) |
205 | | - (jpyfile (expand-file-name (file-name-nondirectory tfile) "/jpy::/")) |
206 | | - (jpydir (expand-file-name (file-name-nondirectory tdir) "/jpy::/"))) |
207 | | - (should (file-exists-p tfile)) |
208 | | - (should (file-exists-p jpyfile)) |
209 | | - (should (file-exists-p tdir)) |
210 | | - (should (file-exists-p jpydir)) |
211 | | - (unwind-protect |
212 | | - (progn |
213 | | - (ert-info ("Error when attempting to delete a file") |
214 | | - (should-error (delete-directory jpyfile))) |
215 | | - (ert-info ("Delete a directory") |
216 | | - (let ((jpyfile2 (expand-file-name "foobar" jpydir))) |
217 | | - (write-region "xxx" nil jpyfile2) |
218 | | - (unwind-protect |
219 | | - (progn |
220 | | - (ert-info ("Error when directory contains files") |
221 | | - (should-error (delete-directory jpydir))) |
222 | | - (ert-info ("Unless recursive is specifed") |
223 | | - (delete-directory jpydir t) |
224 | | - (should-not (file-exists-p jpyfile2)) |
225 | | - (should-not (file-directory-p tdir)))) |
226 | | - (when (file-exists-p jpyfile2) |
227 | | - (delete-file jpyfile2)))) |
228 | | - (should-not (file-exists-p tdir)) |
229 | | - (ert-info ("Ensure cache is cleared") |
230 | | - (should-not (file-exists-p jpydir))))) |
231 | | - (when (file-exists-p tfile) |
232 | | - (delete-file tfile)) |
233 | | - (when (file-exists-p tdir) |
234 | | - (delete-directory tdir t)))))) |
| 202 | + (let ((jupyter--debug t)) |
| 203 | + (jupyter-test-at-temporary-directory |
| 204 | + (let* ((tfile (make-temp-file "delete-directory")) |
| 205 | + (tdir (make-temp-file "delete-directory" 'directory)) |
| 206 | + (jpyfile (expand-file-name (file-name-nondirectory tfile) "/jpy::/")) |
| 207 | + (jpydir (expand-file-name (file-name-nondirectory tdir) "/jpy::/"))) |
| 208 | + (should (file-exists-p tfile)) |
| 209 | + (should (file-exists-p jpyfile)) |
| 210 | + (should (file-exists-p tdir)) |
| 211 | + (should (file-exists-p jpydir)) |
| 212 | + (unwind-protect |
| 213 | + (progn |
| 214 | + (ert-info ("Error when attempting to delete a file") |
| 215 | + (should-error (delete-directory jpyfile))) |
| 216 | + (ert-info ("Delete a directory") |
| 217 | + (let ((jpyfile2 (expand-file-name "foobar" jpydir))) |
| 218 | + (write-region "xxx" nil jpyfile2) |
| 219 | + (unwind-protect |
| 220 | + (progn |
| 221 | + (ert-info ("Error when directory contains files") |
| 222 | + (should-error (delete-directory jpydir))) |
| 223 | + (ert-info ("Unless recursive is specifed") |
| 224 | + (delete-directory jpydir t) |
| 225 | + (should-not (file-exists-p jpyfile2)) |
| 226 | + (should-not (file-directory-p tdir)))) |
| 227 | + (when (file-exists-p jpyfile2) |
| 228 | + (delete-file jpyfile2)))) |
| 229 | + (should-not (file-exists-p tdir)) |
| 230 | + (ert-info ("Ensure cache is cleared") |
| 231 | + (should-not (file-exists-p jpydir))))) |
| 232 | + (when (file-exists-p tfile) |
| 233 | + (delete-file tfile)) |
| 234 | + (when (file-exists-p tdir) |
| 235 | + (delete-directory tdir t))))))) |
235 | 236 |
|
236 | 237 | (ert-deftest jupyter-tramp-file-attributes () |
237 | 238 | :tags '(tramp server) |
|
0 commit comments