combox

split and encrypted files between online file storage providers
git clone git://git.ricketyspace.net/combox.git
Log | Files | Refs

commit 4095aa4caf8021a6b8f44c2c4ca3b76a9c26a91f
parent d867cd1bc3cc0bd83d3e6727375f7f7fe689e379
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Wed,  1 Apr 2015 17:04:35 -0400

new variable at NodeDirMonitor -- `num_nodes'

`num_nodes' a value that represents the number of node directories.

  modified:   combox/events.py
  modified:   tests/events_test.py

Diffstat:
combox/events.py | 2++
tests/events_test.py | 9+++++++++
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/combox/events.py b/combox/events.py @@ -188,6 +188,8 @@ class NodeDirMonitor(LoggingEventHandler): self.config = config self.silo = ComboxSilo(self.config, dblock) + self.num_nodes = len(get_nodedirs(self.config)) + def shardp(self, path): """Returns True if `path' is a shard diff --git a/tests/events_test.py b/tests/events_test.py @@ -228,6 +228,15 @@ class TestEvents(object): assert not silo.stale(self.lorem_ipsum) + def test_NDM_numnodes(self): + """Tests whether the NodeDirMonitor's num_nodes variable has the + right value. + + """ + nmonitor = NodeDirMonitor(self.config, self.silo_lock) + assert_equal(2, nmonitor.num_nodes) + + def test_NDM(self): """ Tests the NodeDirMonitor class.