예제 #1
0
 def setUp(self):
     super(TestClient, self).setUp()
     settings = {'elasticsearch.host': self.es_cluster.urls}
     app = main({}, **settings)
     self.server = StopableWSGIServer.create(app)
     docs = []
     for i in range(1, 32):
         docs.append({
             'date': '2012-01-%.2d' % i,
             'downloads_count': i,
             'add_on': str(i % 2 + 1),
         })
     self.es_client.bulk_index('time_2012-01', 'downloads', docs)
     for j in range(2, 6):
         self.es_client.index('time_2012-%.2d' % j, 'downloads', {
             'date': '2012-%.2d-01' % j,
             'downloads_count': j,
             'add_on': str(j % 2),
         })
     self.es_client.refresh()
     self.server.wait()
예제 #2
0
 def setUp(self):
     global_config = {}
     wsgiapp = main(global_config)
     self.app = TestApp(wsgiapp)
예제 #3
0
 def setUp(self):
     global_config = {}
     wsgiapp = main(global_config)
     self.app = TestApp(wsgiapp)