示例#1
0
 def default_time():
     batch = Batch(self.batch_csv,
                   pipeline_options=self.pipeline_options)
     start = timer()
     batch.run()
     end = timer()
     return end - start
示例#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
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#8
0
 def custom_sleep_time():
     batch = Batch(self.batch_csv, sleep=3)
     start = timer(); batch.run(); end = timer()
     return end - start
示例#9
0
 def default_time():
     batch = Batch(self.batch_csv)
     start = timer(); batch.run(); end = timer()
     return end - start
示例#10
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
示例#11
0
 def default_time():
     batch = Batch(self.batch_csv, pipeline_options=self.pipeline_options)
     start = timer(); batch.run(); end = timer()
     return end - start