コード例 #1
0
ファイル: test_writers.py プロジェクト: bbotella/fluxo
class ConsoleWriterTest(unittest.TestCase):
    def setUp(self):
        self.options = {'log_level': 'DEBUG', 'logger_name': 'export-pipeline'}
        self.writer = ConsoleWriter(self.options, meta())

    def tearDown(self):
        self.writer.close()

    def test_write_console(self):
        items_to_write = []
        for i in range(0, 10):
            item = BaseRecord()
            item['key'] = i
            item['value'] = random.randint(0, 10000)
            items_to_write.append(item)

        self.writer.write_batch(items_to_write)
        self.assertEqual(self.writer.get_metadata('items_count'), 10)
コード例 #2
0
class ConsoleWriterTest(unittest.TestCase):
    def setUp(self):
        self.options = {
            'log_level': 'DEBUG',
            'logger_name': 'export-pipeline'
        }
        self.writer = ConsoleWriter(self.options, meta())

    def tearDown(self):
        self.writer.close()

    def test_write_console(self):
        items_to_write = []
        for i in range(0, 10):
            item = BaseRecord()
            item['key'] = i
            item['value'] = random.randint(0, 10000)
            items_to_write.append(item)

        self.writer.write_batch(items_to_write)
        self.assertEqual(self.writer.get_metadata('items_count'), 10)
コード例 #3
0
 def setUp(self):
     self.options = {
         'log_level': 'DEBUG',
         'logger_name': 'export-pipeline'
     }
     self.writer = ConsoleWriter(self.options, meta())
コード例 #4
0
ファイル: test_writers.py プロジェクト: bbotella/fluxo
 def setUp(self):
     self.options = {'log_level': 'DEBUG', 'logger_name': 'export-pipeline'}
     self.writer = ConsoleWriter(self.options, meta())