summaryrefslogtreecommitdiffstats
path: root/tests/events_test.py
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-09-29 14:15:49 -0400
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-09-29 14:15:49 -0400
commit54d70dad75387e0369c2b67dacff80d32d3cfc1e (patch)
treeb440706df3bd3c08fc6dd20ceeb5ab2a29a76c35 /tests/events_test.py
parent6171a67bb57f5ac10b43da785fe24aeb83fbd609 (diff)
[bug fix] fix for :b#2:
Now combox ignores tmp files created by editors. modified: TODO.org modified: combox/events.py modified: tests/events_test.py modified: tests/utils.py
Diffstat (limited to 'tests/events_test.py')
-rw-r--r--tests/events_test.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/events_test.py b/tests/events_test.py
index 16467b2..7daabff 100644
--- a/tests/events_test.py
+++ b/tests/events_test.py
@@ -42,7 +42,7 @@ from combox.file import (relative_path, purge_dir, hash_file,
from combox.silo import ComboxSilo
from tests.utils import (get_config, shardedp, dirp, renamedp,
path_deletedp, rm_nodedirs, rm_configdir,
- purge_nodedirs, purge)
+ purge_nodedirs, purge, not_shardedp)
class TestEvents(object):
@@ -94,6 +94,19 @@ class TestEvents(object):
silo = ComboxSilo(self.config, self.silo_lock)
assert silo.exists(self.TEST_FILE_COPY_0)
+ # Test - tmp file creation.
+ # combox must ignore it.
+ self.TEST_TMP_FILE = "%s~" % self.TEST_FILE
+ copyfile(self.TEST_FILE, self.TEST_TMP_FILE)
+ # wait for a second.
+ time.sleep(1)
+ ## confirm that shards were not created.
+ not_shardedp(self.TEST_TMP_FILE)
+ ## confirm that it did not get registered in the silo.
+ assert not silo.exists(self.TEST_TMP_FILE)
+ # purge it later.
+ self.purge_list.append(self.TEST_TMP_FILE)
+
# Test - File deletion.
remove(self.TEST_FILE_COPY_0)
time.sleep(1)