def test_ephemeral_ver_option(self): protocol = FakeControlProtocol([]) config = TorConfig(protocol) hs = EphemeralOnionService( config, ports=["80 127.0.0.1:80"], ver=2, ) self.assertEqual(2, hs.version)
def test_ephemeral_extra_kwargs(self): protocol = FakeControlProtocol([]) config = TorConfig(protocol) with self.assertRaises(ValueError) as ctx: EphemeralOnionService( config, ports=["80 127.0.0.1:80"], ver=2, something_funny="foo", ) self.assertIn( "Unknown kwarg", str(ctx.exception), )