diff --git a/test/test_endpoints.py b/test/test_endpoints.py index 1c03dd70..c4c64ee6 100644 --- a/test/test_endpoints.py +++ b/test/test_endpoints.py @@ -542,7 +542,11 @@ def test_progress_updates(self, ftb): args = (50, "blarg", "Doing that thing we talked about.") # kind-of cheating, test-wise? ep._tor_progress_update(*args) - self.assertTrue(ding.called_with(*args)) + ding.assert_called() + self.assertEqual( + ding.call_args[0][1:], + args[1:], + ) def test_progress_updates_error(self, ftb): config = TorConfig() diff --git a/test/test_torstate.py b/test/test_torstate.py index 184a2982..77c930a8 100644 --- a/test/test_torstate.py +++ b/test/test_torstate.py @@ -648,7 +648,8 @@ def attach_stream(self, stream, circuits): for ignored in self.state.event_map.items(): self.send(b"250 OK") - self.send(b"650 STREAM 1 NEW 0 ca.yahoo.com:80 SOURCE_ADDR=127.0.0.1:54327 PURPOSE=USER") + self.send(b"650 STREAM 1 NEW 0 links.duckduckgo.com:443 SOURCE_ADDR=127.0.0.1:54327 PURPOSE=USER") + self.send(b'650 STREAM 1 CONTROLLER_WAIT 0 links.duckduckgo.com:443 SOCKS_USERNAME="duckduckgo.com" SOCKS_PASSWORD="4a2f6ef74fe3aa0bf8876b4e927a28f7" CLIENT_PROTOCOL=SOCKS5 NYM_EPOCH=0 SESSION_GROUP=-5 ISO_FIELDS=SOCKS_USERNAME,SOCKS_PASSWORD,CLIENTADDR,SESSION_GROUP,NYM_EPOCH') self.send(b"650 STREAM 1 REMAP 0 87.248.112.181:80 SOURCE=CACHE") self.assertEqual(len(attacher.streams), 1) self.assertEqual(attacher.streams[0].id, 1) diff --git a/tox.ini b/tox.ini index 222f1435..4614d6ba 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ # stretch: 16.3.0-1 [tox] -envlist = clean,flake8,stats,readme_render,{py27,py36,py37,py38,py39,pypy}-{tx16,tx17,tx18,tx19,tx20},{py36,py37,py38,py39}-tx21 +envlist = clean,flake8,stats,readme_render,{py27,py36,py37,py38,py39,pypy}-{tx18,tx19,tx20},{py36,py37,py38,py39}-tx21 # if you're not using detox, you can use this list to get # "all environments" coverage stats: # tox -e 'clean,flake8,py27-tx18,pypy-tx18,py35-tx18,stats' @@ -40,8 +40,6 @@ deps= coverage-lcov toml # needed by above, but that doesn't declare it?? cryptography - tx16: twisted>=16.0.0,<17.0.0 - tx17: twisted>=17.0.0,<18.0.0 tx18: twisted>=18.0.0,<19.0.0 tx19: twisted>=19.0.0,<20.0.0 tx20: twisted>=20.0.0,<21.0.0 diff --git a/txtorcon/controller.py b/txtorcon/controller.py index f1ec0ae6..09d7d8c3 100644 --- a/txtorcon/controller.py +++ b/txtorcon/controller.py @@ -935,7 +935,7 @@ def is_ready(self): "status/circuit-established", ) returnValue( - not( + not ( int(info["dormant"]) or not int(info["status/enough-dir-info"]) or not int(info["status/circuit-established"]) diff --git a/txtorcon/stream.py b/txtorcon/stream.py index 6df5c2db..6ad98b81 100644 --- a/txtorcon/stream.py +++ b/txtorcon/stream.py @@ -244,6 +244,9 @@ def update(self, args): elif self.state in ['NEWRESOLVE', 'SENTRESOLVE']: pass # print self.state, self, args + elif self.state == 'CONTROLLER_WAIT': + pass # waiting for us to ATTACHSTREAM + else: raise RuntimeError("Unknown state: %s" % self.state)