'Test the crawler takes a step when an introduction is made by the walker'

def test_crawler_on_introduction_received(self):

    TriblerChainCommunityCrawler.CrawlerDelay = 10000000
    crawler = DispersyTestFunc.create_nodes(self, 1, community_class=TriblerChainCommunityCrawler, memory_database=False)[0]
    (node,) = self.create_nodes(1)
    node._community.cancel_pending_task('take    fast    steps')
    node._community.cancel_pending_task('take    step')
    node._community.cancel_pending_task('start_walking')
    target_node_from_crawler = self._create_target(node, crawler)
    intro_request_info = crawler.call(IntroductionRequestCache, crawler.community, None)
    intro_response = node.create_introduction_response(target_node_from_crawler, node.lan_address, node.wan_address, node.lan_address, node.wan_address, u'unknown', False, intro_request_info.number)
    intro_response._candidate = target_node_from_crawler
    crawler.community.request_cache._identifiers[crawler.community.request_cache._create_identifier(intro_request_info.number, u'introduction-request')] = intro_request_info
    counter = [0]
    def on_crawl_request(cand, pk, sequence_number=None):
        if (sequence_number != (-1)):
            counter[0] += 1
    crawler.community.send_crawl_request = on_crawl_request
    crawler.call(crawler.community.on_introduction_response, [intro_response])
    self.assertEqual(counter[0], 1)
