No need to check for None in reflector test tear down

This commit is contained in:
Kay Kurokawa 2017-11-15 10:19:01 -05:00 committed by Jack Robison
parent ae74d80c8a
commit 4971ddda78
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF

View file

@ -162,25 +162,17 @@ class TestReflector(unittest.TestCase):
def take_down_env(self):
d = defer.succeed(True)
## Close client classes ##
if self.lbry_file_manager is not None:
d.addCallback(lambda _: self.lbry_file_manager.stop())
if self.session is not None:
d.addCallback(lambda _: self.session.shut_down())
if self.stream_info_manager is not None:
d.addCallback(lambda _: self.stream_info_manager.stop())
d.addCallback(lambda _: self.lbry_file_manager.stop())
d.addCallback(lambda _: self.session.shut_down())
d.addCallback(lambda _: self.stream_info_manager.stop())
## Close server classes ##
if self.server_blob_manager is not None:
d.addCallback(lambda _: self.server_blob_manager.stop())
if self.server_lbry_file_manager is not None:
d.addCallback(lambda _: self.server_lbry_file_manager.stop())
if self.server_session is not None:
d.addCallback(lambda _: self.server_session.shut_down())
if self.server_stream_info_manager is not None:
d.addCallback(lambda _: self.server_stream_info_manager.stop())
d.addCallback(lambda _: self.server_blob_manager.stop())
d.addCallback(lambda _: self.server_lbry_file_manager.stop())
d.addCallback(lambda _: self.server_session.shut_down())
d.addCallback(lambda _: self.server_stream_info_manager.stop())
if self.reflector_port is not None:
d.addCallback(lambda _: self.reflector_port.stopListening())
d.addCallback(lambda _: self.reflector_port.stopListening())
def delete_test_env():
try: