summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2014-12-23 16:10:36 +0000
committerSam Thursfield <sam@afuera.me.uk>2014-12-26 22:53:15 +0000
commitd6a0c2dc26f9b9d4496954864d95acf16844c896 (patch)
treee1aa2b61ed6b675eaec08d0dc7242010af3046df
parent75b81e54d1e9831a92e846dc043975361c63ac4c (diff)
downloadtracker-d6a0c2dc26f9b9d4496954864d95acf16844c896.tar.gz
functional-tests: Fix 'not a directory' error in writeback tests
This makes the following error less likely, and clearer when it does occur: (tracker-miner-fs:28886): Tracker-WARNING **: Could not open directory 'file:///home/sam/tracker-tests/writeback': Not a directory
-rw-r--r--tests/functional-tests/common/utils/writebacktest.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/functional-tests/common/utils/writebacktest.py b/tests/functional-tests/common/utils/writebacktest.py
index 801434aef..63c3ef7b6 100644
--- a/tests/functional-tests/common/utils/writebacktest.py
+++ b/tests/functional-tests/common/utils/writebacktest.py
@@ -63,6 +63,12 @@ class CommonTrackerWritebackTest (ut.TestCase):
datadir = os.path.join (cfg.DATADIR, "tracker-tests",
"test-writeback-data")
+ if not os.path.exists(WRITEBACK_TMP_DIR):
+ os.makedirs(WRITEBACK_TMP_DIR)
+ else:
+ if not os.path.isdir(WRITEBACK_TMP_DIR):
+ raise Exception("%s exists already and is not a directory" % WRITEBACK_TMP_DIR)
+
for testfile in [TEST_FILE_JPEG, TEST_FILE_PNG,TEST_FILE_TIFF]:
origin = os.path.join (datadir, testfile)
log ("Copying %s -> %s" % (origin, WRITEBACK_TMP_DIR))