[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy 6e37aae 067/133: Added unit test for downloa
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy 6e37aae 067/133: Added unit test for download |
Date: |
Sat, 27 Mar 2021 14:48:45 -0400 (EDT) |
branch: externals/ssh-deploy
commit 6e37aae861d79eebe288cb4eb3d32b8af1ddd257
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added unit test for download
---
ssh-deploy-test.el | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)
diff --git a/ssh-deploy-test.el b/ssh-deploy-test.el
index 540bf5e..a9dc06b 100644
--- a/ssh-deploy-test.el
+++ b/ssh-deploy-test.el
@@ -36,6 +36,52 @@
(autoload 'ssh-deploy--file-is-in-path-p "ssh-deploy")
(autoload 'ssh-deploy--is-not-empty-string-p "ssh-deploy")
+(defun ssh-deploy-test--download ()
+ "Test downloads."
+
+ (require 'ediff-util)
+
+ (let ((directory-a (expand-file-name "test-a/"))
+ (directory-b (expand-file-name "test-b/")))
+
+ ;; Delete directories if they already exists
+ (when (file-directory-p directory-a)
+ (delete-directory directory-a t))
+ (when (file-directory-p directory-b)
+ (delete-directory directory-b t))
+
+ (make-directory-internal directory-a)
+ (make-directory-internal directory-b)
+
+ (let* ((file-a (expand-file-name "test-b" directory-a))
+ (file-b (expand-file-name "test-b" directory-b))
+ (file-b-contents "Random text")
+ (ssh-deploy-root-local directory-a)
+ (ssh-deploy-root-remote directory-b))
+
+ (when (and ssh-deploy-root-local
+ ssh-deploy-root-remote)
+
+ ;; Create a new file and add it's contents
+ (find-file file-b)
+ (insert file-b-contents)
+ (save-buffer)
+
+ ;; Visit local root
+ (let ((default-directory directory-a))
+
+ ;; Download file
+ (ssh-deploy-download file-b file-a 0 nil 0)
+
+ ;; Verify that both files have equal contents
+ (should (equal t (ediff-same-file-contents file-a file-b)))
+
+ (delete-file file-b)
+ (delete-file file-a))))
+
+ (delete-directory directory-a t)
+ (delete-directory directory-b t)))
+
(defun ssh-deploy-test--get-revision-path ()
"Test this function."
(should (string= (expand-file-name "./_mydirectory_random-file.txt")
(ssh-deploy--get-revision-path "/mydirectory/random-file.txt" (expand-file-name
".")))))
@@ -56,7 +102,8 @@
"Run test for plug-in."
(ssh-deploy-test--get-revision-path)
(ssh-deploy-test--file-is-in-path)
- (ssh-deploy-test--is-not-empty-string))
+ (ssh-deploy-test--is-not-empty-string)
+ (ssh-deploy-test--download))
(ssh-deploy-test)
- [elpa] externals/ssh-deploy 89bb950 131/133: Merge pull request #69 from housensen/patch-1, (continued)
- [elpa] externals/ssh-deploy 89bb950 131/133: Merge pull request #69 from housensen/patch-1, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 7a5a087 066/133: Updated version, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 664f52c 072/133: Improved missing async function error and replaced require with autoload, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 8c354e1 092/133: Added Travis CI file to repo, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy f61f1ef 041/133: Fixed bug where all DirectoryVariables was not passed on from handlers, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy a1a9d3c 051/133: Work on lisp code styling with (if), (progn) and (when), Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e0bf686 054/133: More (if), (when) and (progn) optimizations, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy efc8be3 058/133: Added another example using plug-in functions from script, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 4044f78 064/133: Hydra compilation working, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy ae5354a 065/133: Fixed issue were remote paths with symlinks didn't work with recursive diff function, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 6e37aae 067/133: Added unit test for download,
Stefan Monnier <=
- [elpa] externals/ssh-deploy 8107b9e 073/133: Added unit test for rename and delete, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e895d6d 079/133: Replaced asynchronous (require) with (autoload), Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 5846974 082/133: Added instructions about how to trigger unit test with async.el integration, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 85a7c37 080/133: Added unit tests for asynchronous operations, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 6ddb12b 090/133: All unit tests for remote changes sync and async and compilation passing, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 8e2507b 085/133: Refactored remote changes function and made unit tests for it, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 8c26f61 091/133: Updated version and change-date, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 6d20dae 109/133: Fixed issue were async directory diff would lock main thread for resolving file links when using the handler, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 9c73fef 110/133: Added support for asynchronous file difference check, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 045e463 095/133: Trying emacs version manager in travis, Stefan Monnier, 2021/03/27