From a04d3b8fe88b22e11d3189e75efc5e22f7abf196 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 21 Feb 2009 00:17:10 -0700 Subject: [PATCH] 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 --- src/allmydata/test/test_system.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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]) -- 2.45.2