itests: Add a check.sh test script for transferwee - transferwee - Download/upload file via wetransfer.com Err tccr.it 70 hgit clone https://github.com/iamleot/transferwee URL:https://github.com/iamleot/transferwee tccr.it 70 1Log /r/transferwee/log.gph tccr.it 70 1Files /r/transferwee/files.gph tccr.it 70 1Refs /r/transferwee/refs.gph tccr.it 70 1README /r/transferwee/file/README.md.gph tccr.it 70 i--- Err tccr.it 70 1commit 6af0b64011f941cd9ca77419d3f199534eb07932 /r/transferwee/commit/6af0b64011f941cd9ca77419d3f199534eb07932.gph tccr.it 70 1parent 5ae4f014ce753dfbdc90c36b92bab2a65f0cb9ff /r/transferwee/commit/5ae4f014ce753dfbdc90c36b92bab2a65f0cb9ff.gph tccr.it 70 hAuthor: Leonardo Taccari URL:mailto:iamleot@gmail.com tccr.it 70 iDate: Sun, 30 Dec 2018 18:24:45 +0100 Err tccr.it 70 i Err tccr.it 70 itests: Add a check.sh test script for transferwee Err tccr.it 70 i Err tccr.it 70 icheck.sh tests transferwee by uploading a test file, downloading Err tccr.it 70 iit and then comparing the uploded one and downloaded one via cmp(1) Err tccr.it 70 ito check if they are the same. Err tccr.it 70 i Err tccr.it 70 iDiffstat: Err tccr.it 70 i A tests/check.sh | 39 +++++++++++++++++++++++++++++++ Err tccr.it 70 i Err tccr.it 70 i1 file changed, 39 insertions(+), 0 deletions(-) Err tccr.it 70 i--- Err tccr.it 70 1diff --git a/tests/check.sh b/tests/check.sh /r/transferwee/file/tests/check.sh.gph tccr.it 70 i@@ -0,0 +1,39 @@ Err tccr.it 70 i+#!/bin/sh Err tccr.it 70 i+ Err tccr.it 70 i+# Err tccr.it 70 i+# Test transferwee by uploading and then downloading a test file. Err tccr.it 70 i+# Err tccr.it 70 i+# To run this test, just invoke: Err tccr.it 70 i+# % ./check.sh Err tccr.it 70 i+# Err tccr.it 70 i+ Err tccr.it 70 i+TRANSFERWEE=$(readlink -f ../transferwee.py) Err tccr.it 70 i+ Err tccr.it 70 i+set -e Err tccr.it 70 i+ Err tccr.it 70 i+testtmpdir=$(mktemp -d '/tmp/transferwee_test_XXXXXX') Err tccr.it 70 i+testtmpfile=hello Err tccr.it 70 i+ Err tccr.it 70 i+cd "${testtmpdir}" Err tccr.it 70 i+ Err tccr.it 70 i+echo "Creating a test file..." Err tccr.it 70 i+echo "Hello world!" > "${testtmpfile}" Err tccr.it 70 i+ Err tccr.it 70 i+echo "Uploading the test file..." Err tccr.it 70 i+url=$(${TRANSFERWEE} upload -m 'Just a text file with the mandatory message...' "${testtmpfile}") Err tccr.it 70 i+echo "test file uploaded as ${url}" Err tccr.it 70 i+ Err tccr.it 70 i+echo "Renaming original test file..." Err tccr.it 70 i+mv "${testtmpfile}" "${testtmpfile}.orig" Err tccr.it 70 i+ Err tccr.it 70 i+echo "Waiting 5 seconds before downloading the file..." Err tccr.it 70 i+sleep 5 Err tccr.it 70 i+ Err tccr.it 70 i+echo "Downloading the test file via ${url}..." Err tccr.it 70 i+${TRANSFERWEE} download "${url}" Err tccr.it 70 i+ Err tccr.it 70 i+echo "Checking if the uploaded file and downloaded file are the same..." Err tccr.it 70 i+cmp "${testtmpfile}.orig" "${testtmpfile}" Err tccr.it 70 i+ Err tccr.it 70 i+cd "${OLDPWD}" Err tccr.it 70 i+rm -rf "${testtmpdir}" Err tccr.it 70 .