diff options
author | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-01-27 22:01:14 -0500 |
---|---|---|
committer | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-01-27 22:01:14 -0500 |
commit | 27e46c36acb6a8465af4c20812c8a8ed7c61d5ba (patch) | |
tree | 251e1208cf06b528e2efab0d185beeaed6d9a66b /tests | |
parent | ba9d681cde57eb053042153ff6a3855ffb57d698 (diff) |
combox/events.py - Wrote first version of housingkeep() method for ComboxDirMonitor class.
The test for this method at tests/events_test.py only tests a part of
it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/events_test.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/events_test.py b/tests/events_test.py index f9579b0..5c726d9 100644 --- a/tests/events_test.py +++ b/tests/events_test.py @@ -32,7 +32,9 @@ from combox.config import get_nodedirs from combox.crypto import decrypt_and_glue from combox.events import ComboxDirMonitor from combox.file import (relative_path, purge_dir, - read_file, write_file) + read_file, write_file, + rm_shards) + from combox.silo import ComboxSilo @@ -238,3 +240,23 @@ def test_CDM(): observer.stop() observer.join() + + +def test_housekeep(): + """ComboxDirMonitor's housekeep method test.""" + + lorem = path.join(FILES_DIR, 'lorem.txt') + lorem_moved = path.join(FILES_DIR, 'lorem.moved.txt') + os.rename(lorem, lorem_moved) + + cdm = ComboxDirMonitor(config) + cdm.housekeep() + + silo = ComboxSilo(config) + assert not silo.exists(lorem) + assert silo.exists(lorem_moved) + shardedp(lorem_moved) + + os.rename(lorem_moved, lorem) + rm_shards(lorem_moved, config) + silo.remove(lorem_moved) |