test_storage.py: more windows-vs-readonly-storage fixes
authorBrian Warner <warner@lothar.com>
Wed, 3 Dec 2008 02:41:02 +0000 (19:41 -0700)
committerBrian Warner <warner@lothar.com>
Wed, 3 Dec 2008 02:41:02 +0000 (19:41 -0700)
src/allmydata/test/test_storage.py

index 043dd4dda9068e50075b3e728253c76b6f2e3924..012e003c07027861cc327887b7c9b02b767128bd 100644 (file)
@@ -575,7 +575,11 @@ class Server(unittest.TestCase):
         stats = ss.get_stats()
         self.failUnlessEqual(stats["storage_server.accepting_immutable_shares"],
                              False)
-        self.failUnlessEqual(stats["storage_server.disk_avail"], 0)
+        if "storage_server.disk_avail" in stats:
+            # windows does not have os.statvfs, so it doesn't give us disk
+            # stats. But if there are stats, readonly_storage means
+            # disk_avail=0
+            self.failUnlessEqual(stats["storage_server.disk_avail"], 0)
 
     def test_discard(self):
         # discard is really only used for other tests, but we test it anyways