Let me use FakeConfig in another test method

This commit is contained in:
Jean-Paul Calderone 2017-06-26 15:41:47 -04:00 committed by Brian Warner
parent 13ff2461b8
commit 777d722b0d

View File

@ -1172,6 +1172,14 @@ class Dispatch(unittest.TestCase):
self.assertEqual(cfg.stderr.getvalue(), expected)
class FakeConfig(object):
no_daemon = True
blur_usage = True
advertise_version = u"fake.version.1"
transit = str('tcp:4321')
rendezvous = str('tcp:1234')
signal_error = True
allow_list = False
class Server(unittest.TestCase):
def setUp(self):
@ -1183,15 +1191,6 @@ class Server(unittest.TestCase):
self.assertEqual(0, result.exit_code)
def test_server_plugin(self):
class FakeConfig(object):
no_daemon = True
blur_usage = True
advertise_version = u"fake.version.1"
transit = str('tcp:4321')
rendezvous = str('tcp:1234')
signal_error = True
allow_list = False
cfg = FakeConfig()
plugin = MyPlugin(cfg)
relay = plugin.makeService(None)