@@ -31,8 +31,8 @@ class TestCircuitEventListener(TorTestCase):
3131 @defer .inlineCallbacks
3232 def setUp (self ):
3333 yield super (TestCircuitEventListener , self ).setUp ()
34- self .circuit_event_listener = CircuitEventListener (self .tor )
35- self .tor .add_circuit_listener (self .circuit_event_listener )
34+ self .circuit_event_listener = CircuitEventListener (self .tor_state )
35+ self .tor_state .add_circuit_listener (self .circuit_event_listener )
3636
3737 @defer .inlineCallbacks
3838 def test_circuit_lifecycle (self ):
@@ -44,7 +44,7 @@ def test_circuit_lifecycle(self):
4444 # XXX argh, we haven't gotten all the events from Tor yet...
4545 # hax to block until we've made Tor do something...
4646 yield circ .close (ifUnused = False )
47- yield self .tor .protocol .get_info ('version' )
47+ yield self .tor_state .protocol .get_info ('version' )
4848 expected_states = ['circuit_new' , 'circuit_launched' , 'circuit_extend' ,
4949 'circuit_extend' , 'circuit_extend' , 'circuit_built' ,
5050 'circuit_closed' ]
@@ -59,7 +59,7 @@ class TestStreamBandwidthListener(TorTestCase):
5959 def setUp (self ):
6060 yield super (TestStreamBandwidthListener , self ).setUp ()
6161 self .fetch_size = 8 * 2 ** 20 # 8MB
62- self .stream_bandwidth_listener = yield StreamBandwidthListener (self .tor )
62+ self .stream_bandwidth_listener = yield StreamBandwidthListener (self .tor_state )
6363
6464 class DummyResource (Resource ):
6565 isLeaf = True
@@ -132,12 +132,12 @@ def test_circ_avg_bw(self):
132132 def do_fetch (self ):
133133 time_start = time .time ()
134134 path = self .random_path ()
135- agent = OnionRoutedAgent (reactor , path = path , state = self .tor )
135+ agent = OnionRoutedAgent (reactor , path = path , state = self .tor_state )
136136 url = "http://127.0.0.1:{}" .format (self .port )
137137 request = yield agent .request ("GET" , url )
138138 body = yield readBody (request )
139139 assert len (body ) == self .fetch_size
140- circ = [c for c in self .tor .circuits .values () if c .path == path ][0 ]
140+ circ = [c for c in self .tor_state .circuits .values () if c .path == path ][0 ]
141141 assert isinstance (circ , Circuit )
142142
143143 # XXX: Wait for circuit to close, then I think we can be sure that
0 commit comments