Example #1
0
class NoFilterTest(unittest.TestCase):
    def setUp(self):
        self.options = {
            'exporter_options': {
                'log_level': 'DEBUG',
                'logger_name': 'export-pipeline'
            }
        }
        self.filter = NoFilter(self.options, meta())

    def test_filter_empty_batch(self):
        self.assertTrue(self.filter.filter_batch([]) == [])

    def test_filter_batch_no_op(self):
        items = [{
            'name': 'item1',
            'value': 'value1'
        }, {
            'name': 'item2',
            'value': 'value2'
        }]
        batch = []
        for item in items:
            record = BaseRecord()
            record.record = item
            batch.append(record)
        self.assertTrue(self.filter.filter_batch(batch) == batch)
Example #2
0
 def setUp(self):
     self.options = {
         'exporter_options': {
             'log_level': 'DEBUG',
             'logger_name': 'export-pipeline'
         }
     }
     self.filter = NoFilter(self.options, meta())
Example #3
0
 def setUp(self):
     self.options = {
         'exporter_options': {
             'log_level': 'DEBUG',
             'logger_name': 'export-pipeline'
         }
     }
     self.filter = NoFilter(self.options, meta())
Example #4
0
class NoFilterTest(unittest.TestCase):

    def setUp(self):
        self.options = {
            'exporter_options': {
                'log_level': 'DEBUG',
                'logger_name': 'export-pipeline'
            }
        }
        self.filter = NoFilter(self.options, meta())

    def test_filter_empty_batch(self):
        self.assertTrue(self.filter.filter_batch([]) == [])

    def test_filter_batch_no_op(self):
        items = [{'name': 'item1', 'value': 'value1'}, {'name': 'item2', 'value': 'value2'}]
        batch = []
        for item in items:
            record = BaseRecord()
            record.record = item
            batch.append(record)
        self.assertTrue(self.filter.filter_batch(batch) == batch)