Exemple #1
0
 def default_time():
     batch = Batch(self.batch_csv,
                   pipeline_options=self.pipeline_options)
     start = timer()
     batch.run()
     end = timer()
     return end - start
Exemple #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
    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)
    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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #8
0
    def test_batch_from_datapackage(self):

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

        self.assertEqual(len(batch.dataset), 1)
Exemple #9
0
    def test_batch_from_csv(self):

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

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

        batch = Batch(self.batch_csv)

        self.assertEqual(len(batch.dataset), 5)
Exemple #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
Exemple #14
0
 def default_time():
     batch = Batch(self.batch_csv, pipeline_options=self.pipeline_options)
     start = timer(); batch.run(); end = timer()
     return end - start