Exemplo n.º 1
0
 def default_time():
     batch = Batch(self.batch_csv,
                   pipeline_options=self.pipeline_options)
     start = timer()
     batch.run()
     end = timer()
     return end - start
Exemplo n.º 2
0
 def custom_sleep_time():
     batch = Batch(self.batch_csv,
                   sleep=3,
                   pipeline_options=self.pipeline_options)
     start = timer()
     batch.run()
     end = timer()
     return end - start
Exemplo n.º 3
0
    def test_batch_with_batch_post_processor(self):
        def say_hi(batch):
            return "Hi!"

        batch = Batch(self.batch_csv, post_task=say_hi)
        rv = batch.run()

        self.assertFalse(rv)
Exemplo n.º 4
0
    def test_batch_with_pipeline_post_process_handler(self):
        def say_hi(pipeline):
            return "Hi!"

        batch = Batch(self.batch_csv, pipeline_post_task=say_hi)
        rv = batch.run()

        self.assertFalse(rv)
Exemplo n.º 5
0
    def test_batch_with_batch_post_processor(self):

        def say_hi(batch):
            return 'Hi!'

        batch = Batch(self.batch_csv, post_task=say_hi)
        rv = batch.run()

        self.assertFalse(rv)
Exemplo n.º 6
0
    def test_batch_with_pipeline_post_process_handler(self):

        def say_hi(pipeline):
            return 'Hi!'

        batch = Batch(self.batch_csv, pipeline_post_task=say_hi)
        rv = batch.run()

        self.assertFalse(rv)
Exemplo n.º 7
0
    def test_batch_with_batch_post_processor(self):

        def say_hi(batch):
            return 'Hi!'

        batch = Batch(self.batch_csv, post_task=say_hi,
                      pipeline_options=self.pipeline_options)
        rv = batch.run()

        self.assertFalse(rv)
Exemplo n.º 8
0
    def test_batch_from_datapackage(self):

        batch = Batch(self.batch_datapackage, source_type='datapackage')

        self.assertEqual(len(batch.dataset), 1)
Exemplo n.º 9
0
    def test_batch_from_csv(self):

        batch = Batch(self.batch_csv, pipeline_options=self.pipeline_options)

        self.assertEqual(len(batch.dataset), 4)
Exemplo n.º 10
0
 def custom_sleep_time():
     batch = Batch(self.batch_csv, sleep=3)
     start = timer(); batch.run(); end = timer()
     return end - start
Exemplo n.º 11
0
 def default_time():
     batch = Batch(self.batch_csv)
     start = timer(); batch.run(); end = timer()
     return end - start
Exemplo n.º 12
0
    def test_batch_from_csv(self):

        batch = Batch(self.batch_csv)

        self.assertEqual(len(batch.dataset), 5)
Exemplo n.º 13
0
 def custom_sleep_time():
     batch = Batch(self.batch_csv, sleep=3, pipeline_options=self.pipeline_options)
     start = timer(); batch.run(); end = timer()
     return end - start
Exemplo n.º 14
0
 def default_time():
     batch = Batch(self.batch_csv, pipeline_options=self.pipeline_options)
     start = timer(); batch.run(); end = timer()
     return end - start