Пример #1
0
 def testArgs(self):
     parser = argparse.ArgumentParser()
     add_wm_args(parser)
     args = '--work-manager=threads --n-workers=3'.split()
     args = parser.parse_args(args)
     process_wm_args(args)
     work_manager = make_work_manager()
     assert isinstance(work_manager, ThreadsWorkManager)
     assert work_manager.n_workers == 3
Пример #2
0
 def testArgs(self):
     parser = argparse.ArgumentParser()
     add_wm_args(parser)
     args='--work-manager=threads --n-workers=3'.split()
     args = parser.parse_args(args)
     process_wm_args(args)
     work_manager = make_work_manager()
     assert isinstance(work_manager, ThreadsWorkManager)
     assert work_manager.n_workers == 3
Пример #3
0
 def testArgFallthrough(self):
     # this test specifies the work manager on the command line, and the worker count in the environment
     # this simply tests whether we look to the environment in the case of a missing command line argument
     os.environ['WM_N_WORKERS'] = str(3)
     parser = argparse.ArgumentParser()
     add_wm_args(parser)
     args = '--work-manager=threads'.split()
     args = parser.parse_args(args)
     process_wm_args(args)
     work_manager = make_work_manager()
     assert isinstance(work_manager, ThreadsWorkManager)
     assert work_manager.n_workers == 3
Пример #4
0
 def testArgFallthrough(self):
     # this test specifies the work manager on the command line, and the worker count in the environment
     # this simply tests whether we look to the environment in the case of a missing command line argument
     os.environ['WM_N_WORKERS'] = str(3)
     parser = argparse.ArgumentParser()
     add_wm_args(parser)
     args='--work-manager=threads'.split()
     args = parser.parse_args(args)
     process_wm_args(args)
     work_manager = make_work_manager()
     assert isinstance(work_manager, ThreadsWorkManager)
     assert work_manager.n_workers == 3