Beispiel #1
0
 def test_build_rawes_url_list_settings(self):
     settings = {
         'rawes.url': 'http://el1.search.org:9200\nhttp://el2.search.org:9200',
         'rawes.path': '/search',
         'rawes.timeout': 123
     }
     r = TestRegistry(settings)
     ES = _build_rawes(r)
     self.assertIsInstance(ES, rawes.Elastic)
     self.assertEqual(2, len(ES.connection_pool.connections))
Beispiel #2
0
 def test_build_rawes_default_settings(self):
     r = TestRegistry()
     ES = _build_rawes(r)
     self.assertIsInstance(ES, rawes.Elastic)
     self.assertEqual(1, len(ES.connection_pool.connections))
Beispiel #3
0
 def test_build_rawes_already_exists(self):
     r = TestRegistry()
     ES = rawes.Elastic('http://localhost:9200')
     r.registerUtility(ES, IRawes, 'rawes')
     ES2 = _build_rawes(r)
     self.assertEqual(ES, ES2)