These values aren't used for the exercised codepaths

So just use None instead.  Kind of a weak fix but a fix nonetheless.
This commit is contained in:
Jean-Paul Calderone 2020-12-10 06:59:41 -05:00
parent 89441d9169
commit d29d9c57e7

View File

@ -791,9 +791,7 @@ class Listeners(unittest.TestCase):
with mock.patch("allmydata.node.Tub", return_value=t):
with self.assertRaises(ValueError) as ctx:
i2p_provider = mock.Mock()
tor_provider = mock.Mock()
create_main_tub(config, tub_options, dfh, fch, i2p_provider, tor_provider)
create_main_tub(config, tub_options, dfh, fch, None, None)
self.assertIn(
"you must choose",
str(ctx.exception),
@ -835,9 +833,7 @@ class Listeners(unittest.TestCase):
t = FakeTub()
with mock.patch("allmydata.node.Tub", return_value=t):
i2p_provider = mock.Mock()
tor_provider = mock.Mock()
create_main_tub(config, tub_options, dfh, fch, i2p_provider, tor_provider)
create_main_tub(config, tub_options, dfh, fch, None, None)
self.assertEqual(t.listening_ports,
["tcp:%d:interface=127.0.0.1" % port1,
"tcp:%d:interface=127.0.0.1" % port2])