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

This commit is contained in:
Brian Warner 2009-02-21 00:17:10 -07:00
parent b9c4f4bdf6
commit a04d3b8fe8

View File

@ -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])