'Testing whether the TunnelCommunity does not reload itself after unloading'

@blocking_call_on_reactor_thread
@inlineCallbacks
def test_unload_receive(self):

    tunnel_community = self.session.lm.tunnel_community
    dispersy = self.session.lm.dispersy
    some_candidate = Candidate(('1.2.3.4', 1234), False)
    some_packet = self.create_valid_packet(tunnel_community)
    dispersy.on_incoming_packets([(some_candidate, some_packet)])
    self.assertIn(tunnel_community, dispersy.get_communities())
    (yield tunnel_community.unload_community())
    self.assertNotIn(tunnel_community, dispersy.get_communities())
    for community in dispersy.get_communities():
        self.assertNotIsInstance(community, HiddenTunnelCommunity)
    dispersy.on_incoming_packets([(some_candidate, some_packet)])
    for community in dispersy.get_communities():
        self.assertNotIsInstance(community, HiddenTunnelCommunity)
