コード例 #1
0
ファイル: test_futures.py プロジェクト: boto/s3transfer
 def test_add_done_callback(self):
     done_callbacks = []
     with ThreadPoolExecutor(max_workers=1) as executor:
         future = executor.submit(return_call_args, 'foo', biz='baz')
         wrapped_future = ExecutorFuture(future)
         wrapped_future.add_done_callback(
             FunctionContainer(done_callbacks.append, 'called'))
     self.assertEqual(done_callbacks, ['called'])
コード例 #2
0
ファイル: test_futures.py プロジェクト: antmd/s3transfer
 def test_add_done_callback(self):
     done_callbacks = []
     with ThreadPoolExecutor(max_workers=1) as executor:
         future = executor.submit(return_call_args, 'foo', biz='baz')
         wrapped_future = ExecutorFuture(future)
         wrapped_future.add_done_callback(
             FunctionContainer(done_callbacks.append, 'called'))
     self.assertEqual(done_callbacks, ['called'])
コード例 #3
0
ファイル: test_futures.py プロジェクト: boto/s3transfer
 def test_done(self):
     with ThreadPoolExecutor(max_workers=1) as executor:
         future = executor.submit(return_call_args, 'foo', biz='baz')
         wrapped_future = ExecutorFuture(future)
     self.assertTrue(wrapped_future.done())
コード例 #4
0
ファイル: test_futures.py プロジェクト: boto/s3transfer
 def test_result(self):
     with ThreadPoolExecutor(max_workers=1) as executor:
         future = executor.submit(return_call_args, 'foo', biz='baz')
         wrapped_future = ExecutorFuture(future)
     self.assertEqual(wrapped_future.result(), (('foo',), {'biz': 'baz'}))
コード例 #5
0
ファイル: test_futures.py プロジェクト: antmd/s3transfer
 def test_done(self):
     with ThreadPoolExecutor(max_workers=1) as executor:
         future = executor.submit(return_call_args, 'foo', biz='baz')
         wrapped_future = ExecutorFuture(future)
     self.assertTrue(wrapped_future.done())
コード例 #6
0
ファイル: test_futures.py プロジェクト: antmd/s3transfer
 def test_result(self):
     with ThreadPoolExecutor(max_workers=1) as executor:
         future = executor.submit(return_call_args, 'foo', biz='baz')
         wrapped_future = ExecutorFuture(future)
     self.assertEqual(wrapped_future.result(), (('foo', ), {'biz': 'baz'}))