]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
remove more RuntimeError from unit tests, for #639
authorBrian Warner <warner@lothar.com>
Mon, 23 Feb 2009 00:28:55 +0000 (17:28 -0700)
committerBrian Warner <warner@lothar.com>
Mon, 23 Feb 2009 00:28:55 +0000 (17:28 -0700)
src/allmydata/test/check_memory.py
src/allmydata/test/no_network.py

index d476ad5172dacda22d9a01a0d589fc1adb3a1ae6..8994cb6639ed9ddd73cd73cf6df56a94c2b898eb 100644 (file)
@@ -57,6 +57,9 @@ def discardPage(url, stall=False, *args, **kwargs):
     reactor.connectTCP(host, port, factory)
     return factory.deferred
 
+class ChildDidNotStartError(Exception):
+    pass
+
 class SystemFramework(pollmixin.PollMixin):
     numnodes = 5
 
@@ -274,7 +277,7 @@ this file are ignored.
                 # the twistd process ends normally (with rc=0) if the child
                 # is successfully launched. It ends abnormally (with rc!=0)
                 # if the child cannot be launched.
-                raise RuntimeError("process ended while waiting for startup")
+                raise ChildDidNotStartError("process ended while waiting for startup")
             return os.path.exists(furl_file)
         d = self.poll(_check, 0.1)
         # once it exists, wait a moment before we read from it, just in case
@@ -399,7 +402,7 @@ this file are ignored.
             d.addCallback(lambda res: u.upload(upload.FileName(files[name], convergence="check-memory convergence string")))
             d.addCallback(lambda results: results.uri)
         else:
-            raise RuntimeError("unknown mode=%s" % self.mode)
+            raise ValueError("unknown mode=%s" % self.mode)
         def _complete(uri):
             uris[name] = uri
             print "uploaded %s" % name
index f04228d575a340ef931d0a2be06dede17384cfaf..731d7d9986691343c8b5055de331e9759a5fd817 100644 (file)
@@ -115,7 +115,7 @@ class NoNetworkClient(Client):
     def stopService(self):
         service.MultiService.stopService(self)
     def when_tub_ready(self):
-        raise RuntimeError("NoNetworkClient has no Tub")
+        raise NotImplementedError("NoNetworkClient has no Tub")
     def init_control(self):
         pass
     def init_helper(self):