def test_old_tor_version(self): protocol = FakeControlProtocol([]) protocol.version = "0.1.2.3" config = TorConfig(protocol) hsdir = self.mktemp() def my_progress(a, b, c): pass eph_d = FilesystemOnionService.create( Mock(), config, hsdir, ports=["80 127.0.0.1:80"], progress=my_progress, ) yield eph_d
def test_unknown_version(self): protocol = FakeControlProtocol([]) protocol.version = "0.1.1.1" config = TorConfig(protocol) hsdir = self.mktemp() os.mkdir(hsdir) hs = yield FilesystemOnionService.create( Mock(), config, hsdir=hsdir, ports=["80 127.0.0.1:4321"], version=99, ) with self.assertRaises(RuntimeError) as ctx: hs.private_key self.assertIn("Don't know how to load", str(ctx.exception))