From 408b12a7e6e7a4edf1a045d22c00fa2924417ac1 Mon Sep 17 00:00:00 2001
From: david-sarah <david-sarah@jacaranda.org>
Date: Tue, 15 Jun 2010 17:16:48 -0700
Subject: [PATCH] test_system.py: investigate failure in
 allmydata.test.test_system.SystemTest.test_upload_and_download_random_key due
 to bytes_sent not being an int

---
 src/allmydata/test/test_system.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py
index 59c8e7f1..0ad6c358 100644
--- a/src/allmydata/test/test_system.py
+++ b/src/allmydata/test/test_system.py
@@ -319,6 +319,7 @@ class SystemTest(SystemTestMixin, unittest.TestCase):
                 # this is really bytes received rather than sent, but it's
                 # convenient and basically measures the same thing
                 bytes_sent = results.ciphertext_fetched
+                self.failUnless(isinstance(bytes_sent, (int, long)), bytes_sent)
 
                 # We currently don't support resumption of upload if the data is
                 # encrypted with a random key.  (Because that would require us
@@ -329,16 +330,16 @@ class SystemTest(SystemTestMixin, unittest.TestCase):
                     # Make sure we did not have to read the whole file the
                     # second time around .
                     self.failUnless(bytes_sent < len(DATA),
-                                "resumption didn't save us any work:"
-                                " read %d bytes out of %d total" %
-                                (bytes_sent, len(DATA)))
+                                    "resumption didn't save us any work:"
+                                    " read %r bytes out of %r total" %
+                                    (bytes_sent, len(DATA)))
                 else:
                     # Make sure we did have to read the whole file the second
                     # time around -- because the one that we partially uploaded
                     # earlier was encrypted with a different random key.
                     self.failIf(bytes_sent < len(DATA),
                                 "resumption saved us some work even though we were using random keys:"
-                                " read %d bytes out of %d total" %
+                                " read %r bytes out of %r total" %
                                 (bytes_sent, len(DATA)))
                 n = self.clients[1].create_node_from_uri(cap)
                 return download_to_data(n)
-- 
2.45.2