From a7fb2c3b3cc9eeea820abfe6579d87617855baef Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Thu, 19 Feb 2015 20:55:37 -0500 Subject: Defined new function in combox.file.cb_path This function, given the path of a file shard, returns the corresponding path of the file in the combox directory. The test for this function is at tests.file_test.TestFile.test_cbpath modified: combox/file.py modified: tests/file_test.py --- tests/file_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/file_test.py b/tests/file_test.py index 50bf261..5cbd371 100644 --- a/tests/file_test.py +++ b/tests/file_test.py @@ -112,6 +112,16 @@ class TestFile(object): self.config, False) + 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_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) + @classmethod def teardown_class(self): """Purge the mess created by this test.""" -- cgit v1.2.3