Esempio n. 1
0
 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")
Esempio n. 3
0
 def test_no_redis_connection(self):
     c = RedisHostCrawler()
     with self.assertRaises(ConnectionError):
         c.crawl()
Esempio n. 4
0
 def test_get_feature(self):
     c = RedisHostCrawler()
     self.assertEqual(c.get_feature(), "redis")
 def test_no_redis_connection(self):
     c = RedisHostCrawler()
     with self.assertRaises(ConnectionError):
         c.crawl()
 def test_get_feature(self):
     c = RedisHostCrawler()
     self.assertEqual(c.get_feature(), "redis")
 def test_get_feature(self):
     c = RedisHostCrawler()
     self.assertEqual(c.get_feature(), "application")