From a7327e72060fbb4dac783f1af41bcb9b4ea6da76 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Wed, 1 Apr 2015 22:00:18 -0400 Subject: updated combox.file.relative_path. This method now returns relative paths w. r. t all node directories. Before it used to return relative paths only w. r. t the first node directory. Also updated the tests for it :~( modified: combox/file.py modified: tests/file_test.py --- tests/file_test.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/file_test.py b/tests/file_test.py index bd81fd7..d8a77ca 100644 --- a/tests/file_test.py +++ b/tests/file_test.py @@ -114,10 +114,14 @@ class TestFile(object): test_file_shard_0 = '%s.shard.0' % test_file_basename test_file_shard_0_abspath = path.join(get_nodedirs(self.config)[0], test_file_shard_0) + test_file_shard_1 = '%s.shard.1' % test_file_basename + test_file_shard_1_abspath = path.join(get_nodedirs(self.config)[1], + test_file_shard_1) assert test_file_shard_0 == relative_path(test_file_shard_0_abspath, self.config, False) - + assert test_file_shard_1 == relative_path(test_file_shard_1_abspath, + self.config, False) def test_cbpath(self): """Tests the cb_path function""" @@ -125,9 +129,13 @@ class TestFile(object): 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) - + test_file_shard_1 = '%s.shard1' % path.basename(self.TEST_FILE) + test_file_shard_1_abspath = path.join(get_nodedirs(self.config)[1], + test_file_shard_1) assert self.TEST_FILE == cb_path(test_file_shard_0_abspath, self.config) + assert self.TEST_FILE == cb_path(test_file_shard_1_abspath, + self.config) # a directory inside combox dir. foo_dir = path.join(self.config['combox_dir'], 'foo') -- cgit v1.2.3