From 5729f1b0b3fd1f04f9f6e1787df3dbb74964a404 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Wed, 8 Apr 2015 16:20:25 -0400 Subject: Added test for directory creation in tests.events_test.TestEvents.test_NDM_oncreated. modified: tests/events_test.py --- tests/events_test.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/events_test.py b/tests/events_test.py index 1c0398d..d4df13d 100644 --- a/tests/events_test.py +++ b/tests/events_test.py @@ -275,6 +275,21 @@ class TestEvents(object): ## check if the new file's info is in silo assert self.silo.exists(self.TEST_FILE_MUTANT) + # Test - directory creation + self.FOO_DIR = path.join(self.FILES_DIR, 'foo') + mk_nodedir(self.FOO_DIR, self.config) + time.sleep(1) + ## check if FOO_DIR is created under the combox directory + assert path.isdir(self.FOO_DIR) + + self.BAR_DIR = path.join(self.FOO_DIR, 'bar') + mk_nodedir(self.BAR_DIR, self.config) + time.sleep(1) + ## check if BAR_DIR is created under the combox directory. + assert path.isdir(self.BAR_DIR) + + self.purge_list.append(self.FOO_DIR) + for i in range(num_nodes): observers[i].stop() observers[i].join() @@ -308,21 +323,6 @@ class TestEvents(object): assert silo.exists(self.TEST_FILE_MUTANT) #### - # Test - directory creation - self.FOO_DIR = path.join(self.FILES_DIR, 'foo') - mk_nodedir(self.FOO_DIR, self.config) - time.sleep(1) - ## check if FOO_DIR is created under the combox directory - assert path.isdir(self.FOO_DIR) - - self.BAR_DIR = path.join(self.FOO_DIR, 'bar') - mk_nodedir(self.BAR_DIR, self.config) - time.sleep(1) - ## check if BAR_DIR is created under the combox directory. - assert path.isdir(self.BAR_DIR) - - self.purge_list.append(self.FOO_DIR) - # Test - Shard deletion. rm_shards(self.TEST_FILE_MUTANT, self.config) time.sleep(1) -- cgit v1.2.3