mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 00:45:52 +00:00
testutil: make SignalMixin actually be a mixin (and not inherit from TestCase), use it from all tests that start notes and thus exec ifconfig
This commit is contained in:
parent
36fa95372a
commit
8307aaccb6
@ -1,12 +1,12 @@
|
||||
|
||||
from allmydata.util import iputil
|
||||
from allmydata.util import iputil, testutil
|
||||
|
||||
from twisted.trial import unittest
|
||||
import re
|
||||
|
||||
DOTTED_QUAD_RE=re.compile("^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$")
|
||||
|
||||
class ListAddresses(unittest.TestCase):
|
||||
class ListAddresses(testutil.SignalMixin, unittest.TestCase):
|
||||
def test_get_local_ip_for(self):
|
||||
addr = iputil.get_local_ip_for('127.0.0.1')
|
||||
self.failUnless(DOTTED_QUAD_RE.match(addr))
|
||||
|
@ -3,8 +3,9 @@ from twisted.trial import unittest
|
||||
from foolscap.eventual import flushEventualQueue
|
||||
|
||||
from allmydata import queen
|
||||
from allmydata.util import testutil
|
||||
|
||||
class Basic(unittest.TestCase):
|
||||
class Basic(testutil.SignalMixin, unittest.TestCase):
|
||||
def test_loadable(self):
|
||||
q = queen.Queen()
|
||||
d = q.startService()
|
||||
|
@ -4,7 +4,7 @@ from twisted.trial import unittest
|
||||
from twisted.internet import defer, reactor
|
||||
from twisted.application import service
|
||||
from allmydata import client, queen, uri, download
|
||||
from allmydata.util import idlib, fileutil
|
||||
from allmydata.util import idlib, fileutil, testutil
|
||||
from foolscap.eventual import flushEventualQueue
|
||||
from twisted.python import log
|
||||
from twisted.python.failure import Failure
|
||||
@ -17,7 +17,7 @@ def flush_but_dont_ignore(res):
|
||||
d.addCallback(_done)
|
||||
return d
|
||||
|
||||
class SystemTest(unittest.TestCase):
|
||||
class SystemTest(testutil.SignalMixin, unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.sparent = service.MultiService()
|
||||
|
@ -3,7 +3,7 @@ import os, signal, sys, time
|
||||
from twisted.internet import reactor
|
||||
from twisted.trial import unittest
|
||||
|
||||
class SignalMixin(unittest.TestCase):
|
||||
class SignalMixin:
|
||||
# This class is necessary for any code which wants to use Processes
|
||||
# outside the usual reactor.run() environment. It is copied from
|
||||
# Twisted's twisted.test.test_process
|
||||
|
Loading…
x
Reference in New Issue
Block a user