summaryrefslogtreecommitdiff
path: root/tests/helpers
diff options
context:
space:
mode:
authorvarac <varac@users.noreply.github.com>2016-02-25 17:15:15 +0100
committervarac <varac@users.noreply.github.com>2016-02-25 17:15:15 +0100
commitc6c759a16b41488f5f6516d0e1e07003334d3b58 (patch)
tree9aefbbb583f5bc1ca6894bbbe0acc54f033fe5da /tests/helpers
parentb8736b39e21251f9a888914822858c704fdb8e08 (diff)
parent2599431bb42380f5d8d45769c9a56175f8137267 (diff)
Merge pull request #103 from kalikaneko/bug/remove-soledad-tempdir2
[bug] remove tempdir after soledad sync test
Diffstat (limited to 'tests/helpers')
-rwxr-xr-xtests/helpers/soledad_sync.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/helpers/soledad_sync.py b/tests/helpers/soledad_sync.py
index b8e8fbc9..f4fc81ae 100755
--- a/tests/helpers/soledad_sync.py
+++ b/tests/helpers/soledad_sync.py
@@ -17,6 +17,7 @@ It takes 5 arguments:
__author__: kali@leap.se
"""
import os
+import shutil
import sys
import tempfile
@@ -56,8 +57,13 @@ def create_docs(soledad):
if __name__ == '__main__':
tempdir = tempfile.mkdtemp()
+
+ def rm_tempdir():
+ shutil.rmtree(tempdir)
+
if len(sys.argv) < 6:
bail(USAGE, 2)
+
uuid, token, server, cert_file, passphrase = sys.argv[1:]
s = get_soledad_instance(
uuid, passphrase, tempdir, server, cert_file, token)
@@ -65,10 +71,12 @@ if __name__ == '__main__':
def onSyncDone(sync_result):
print "SYNC_RESULT:", sync_result
s.close()
+ rm_tempdir()
reactor.stop()
def log_and_exit(f):
log.err(f)
+ rm_tempdir()
reactor.stop()
def start_sync():