summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-04-01 22:00:18 -0400
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-04-01 22:00:18 -0400
commita7327e72060fbb4dac783f1af41bcb9b4ea6da76 (patch)
treef6f82fc1ce79972008737f281b16a05dd72ccb01 /tests
parent4095aa4caf8021a6b8f44c2c4ca3b76a9c26a91f (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/file_test.py12
1 files changed, 10 insertions, 2 deletions
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')