def test_redis_host_crawler(self): with mock.patch('redis.Redis', MockedRedisClient): c = RedisHostCrawler() emitted_tuple = c.crawl()[0] self.assertEqual(emitted_tuple[0], "redis", "feature key must be equal to redis") self.assertIsInstance(emitted_tuple[1], RedisFeature) self.assertEqual(emitted_tuple[2], "application", "feature type must be equal to application")
def test_redis_host_crawler(self): with mock.patch('redis.Redis', MockedRedisClient): c = RedisHostCrawler() emitted_tuple = c.crawl()[0] self.assertEqual(emitted_tuple[0], "redis", "feature key must be equal to redis") self.assertIsInstance(emitted_tuple[1], RedisFeature) self.assertEqual(emitted_tuple[2], "application", "feature type must be equal to application")
def test_no_redis_connection(self): c = RedisHostCrawler() with self.assertRaises(ConnectionError): c.crawl()
def test_no_redis_connection(self): c = RedisHostCrawler() with self.assertRaises(ConnectionError): c.crawl()