]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_system: oops, don't assume that all files in storage/ are in a deep storage...
authorBrian Warner <warner@lothar.com>
Sat, 21 Feb 2009 07:17:10 +0000 (00:17 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 21 Feb 2009 07:17:10 +0000 (00:17 -0700)
src/allmydata/test/test_system.py

index 5f7db1d68b5ea2583e1a02671ff5d920f45cd881..e1d16a25ad5a93a2c2aba893580031aabf771ad8 100644 (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])