def test_redis_container_crawler_fordocker(self, *args): c = RedisContainerCrawler() emitted_tuple = c.crawl("mockcontainerid")[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_container_no_connect(self, *args): c = RedisContainerCrawler() with self.assertRaises(ConnectionError): c.crawl(1234)
def test_no_available_ports(self): c = RedisContainerCrawler() c.crawl(1234) pass
def test_get_feature(self): c = RedisContainerCrawler() self.assertEqual(c.get_feature(), "redis")
def test_no_available_ports(self): c = RedisContainerCrawler() with self.assertRaises(ConnectionError): c.crawl("mockcontainerid")
def test_set_default_port(self): c = RedisContainerCrawler() emitted_tuple = c.crawl("mockcontainerid")[0] self.assertEqual(emitted_tuple[0], "redis", "feature key must be equal to redis")
def test_none_redis_container_crawler(self): c = RedisContainerCrawler() with self.assertRaises(NameError): c.crawl("mockcontainerid")
def test_get_feature(self): c = RedisContainerCrawler() self.assertEqual(c.get_feature(), "application")