summaryrefslogtreecommitdiffstats
path: root/tests/file_test.py
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-02-20 08:37:24 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-02-20 08:37:24 -0500
commit79bc74432d42006ac0cedebc2291e8f6b6d1cddb (patch)
treef357e5df9f2c697105c3380a5c6c61782bce3102 /tests/file_test.py
parent8a670ce3642d84cda9a4657d133da2b06b12ef3f (diff)
Refactored combox.file.cb_path to accept a file or a directory under a node directory.
It returns the path of the respective file or directory in the combox directory. Also updated the test for this function at tests.file_test.TestFile.test_cbpath modified: combox/file.py modified: tests/file_test.py
Diffstat (limited to 'tests/file_test.py')
-rw-r--r--tests/file_test.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/file_test.py b/tests/file_test.py
index 5cbd371..3e14343 100644
--- a/tests/file_test.py
+++ b/tests/file_test.py
@@ -115,13 +115,20 @@ class TestFile(object):
def test_cbpath(self):
"""Tests the get_cbpath function"""
split_and_encrypt(self.TEST_FILE, self.config)
- test_file_shard_0 = '%s.shard.0' % path.basename(self.TEST_FILE)
+ test_file_shard_0 = '%s.shard0' % path.basename(self.TEST_FILE)
test_file_shard_0_abspath = path.join(get_nodedirs(self.config)[0],
test_file_shard_0)
assert self.TEST_FILE == cb_path(test_file_shard_0_abspath,
self.config)
+ # a directory inside combox dir.
+ foo_dir = path.join(self.config['combox_dir'], 'foo')
+ mk_nodedir(foo_dir, self.config)
+ foo_nodedir = path.join(get_nodedirs(self.config)[0],
+ 'foo')
+ assert foo_dir == cb_path(foo_nodedir, self.config)
+
@classmethod
def teardown_class(self):
"""Purge the mess created by this test."""