Beispiel #1
0
 def setUp(self):
     self.test_raw_data = ElasticSearchOutput(source='localhost',
                                              index=INDEX,
                                              content_field='abstract')
     self.test_raw_data.import_from_iterable(read_input(
         '{}/test_data_json_stream.json'.format(test_data_path)),
                                             field_to_hash=CONTENT_FIELD)
Beispiel #2
0
    def setUp(self):
        self.test_raw_data = ElasticSearchOutput(
            source='localhost',
            index=INDEX,
            content_field='abstract'
        )
        try:
            self.test_raw_data.import_from_iterable(read_input(
                '{}/test_data_json_stream.json'.format(test_data_path)),
                field_to_hash=CONTENT_FIELD)

        except ConnectionError:
            raise SkipTest("Skipping Elasticsearch test - elasticsearch not running")
Beispiel #3
0
class TestElasticSearchOutput(unittest.TestCase, BaseOutputTest):
    def setUp(self):
        self.test_raw_data = ElasticSearchOutput(source='localhost',
                                                 index=INDEX,
                                                 content_field='abstract')
        self.test_raw_data.import_from_iterable(read_input(
            '{}/test_data_json_stream.json'.format(test_data_path)),
                                                field_to_hash=CONTENT_FIELD)

    def tearDown(self):
        instance = elasticsearch.Elasticsearch("localhost")
        instance.indices.delete(INDEX)
        if instance.indices.exists("{}_year_alias_date".format(INDEX)):
            instance.indices.delete("{}_year_alias_date".format(INDEX))
Beispiel #4
0
class TestElasticSearchOutput(unittest.TestCase, BaseOutputTest):
    def setUp(self):
        self.test_raw_data = ElasticSearchOutput(
            source='localhost',
            index=INDEX,
            content_field='abstract'
        )
        self.test_raw_data.import_from_iterable(read_input(
            '{}/test_data_json_stream.json'.format(test_data_path)),
            field_to_hash=CONTENT_FIELD)

    def tearDown(self):
        instance = elasticsearch.Elasticsearch("localhost")
        instance.indices.delete(INDEX)
        if instance.indices.exists("{}_year_alias_date".format(INDEX)):
            instance.indices.delete("{}_year_alias_date".format(INDEX))
Beispiel #5
0
 def setUp(self):
     self.test_raw_data = ElasticSearchOutput(
         source='localhost',
         index=INDEX,
         content_field='abstract'
     )
     self.test_raw_data.import_from_iterable(read_input(
         '{}/test_data_json_stream.json'.format(test_data_path)),
         field_to_hash=CONTENT_FIELD)