From: Brian Warner Date: Sat, 21 Feb 2009 07:17:10 +0000 (-0700) Subject: test_system: oops, don't assume that all files in storage/ are in a deep storage... X-Git-Tag: allmydata-tahoe-1.4.0~158 X-Git-Url: https://git.rkrishnan.org/architecture.txt?a=commitdiff_plain;h=a04d3b8fe88b22e11d3189e75efc5e22f7abf196;p=tahoe-lafs%2Ftahoe-lafs.git test_system: oops, don't assume that all files in storage/ are in a deep storage/shares/prefix/si/shnum path, since now the crawler pickle has a short path --- diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index 5f7db1d6..e1d16a25 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -437,7 +437,9 @@ class SystemTest(SystemTestMixin, unittest.TestCase): if not filenames: continue pieces = dirpath.split(os.sep) - if pieces[-4] == "storage" and pieces[-3] == "shares": + if (len(pieces) >= 5 + and pieces[-4] == "storage" + and pieces[-3] == "shares"): # we're sitting in .../storage/shares/$START/$SINDEX , and there # are sharefiles here assert pieces[-5].startswith("client") @@ -1311,7 +1313,9 @@ class SystemTest(SystemTestMixin, unittest.TestCase): if not filenames: continue pieces = dirpath.split(os.sep) - if pieces[-4] == "storage" and pieces[-3] == "shares": + if (len(pieces) >= 4 + and pieces[-4] == "storage" + and pieces[-3] == "shares"): # we're sitting in .../storage/shares/$START/$SINDEX , and there # are sharefiles here filename = os.path.join(dirpath, filenames[0])