def main(): parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument('-f', '--file', metavar='test_file', nargs=1, help='test file', required=False) group.add_argument('-d', '--directory', metavar='test_directory', nargs=1, help='directory of test files') args = parser.parse_args() user_input = args.directory[0] if args.directory else args.file[0] integration_config.load_integrations(user_input) threader.launch_threads( threader.build_threads( registrar.register(loader.load_test_files(user_input))))
def main(): parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument( '-f', '--file', metavar='test_file', nargs=1, help='test file', required=False ) group.add_argument( '-d', '--directory', metavar='test_directory', nargs=1, help='directory of test files' ) args = parser.parse_args() user_input = args.directory[0] if args.directory else args.file[0] integration_config.load_integrations(user_input) threader.launch_threads( threader.build_threads( registrar.register(loader.load_test_files(user_input)) ) )
from doublex import Spy, Mock from expects import expect, equal from doublex_expects import have_been_called from pysellus import registrar from pysellus.registrar import expect as expect_ with description('the registrar module'): with it('should call every function passed to it'): function_list = [ Spy().a_function, Spy().another_function ] registrar.register(function_list) for function in function_list: expect(function).to(have_been_called.once) with it('should add a function list to the dictionary of streams to functions'): stream = Mock() function_list = [ Spy().a_function, Spy().another_function ] expect_(stream)(*function_list) for function in function_list: expect(function).to_not(have_been_called) expect(
from doublex import Spy, Mock from expects import expect, equal from doublex_expects import have_been_called from pysellus import registrar from pysellus.registrar import expect as expect_ with description('the registrar module'): with it('should call every function passed to it'): function_list = [Spy().a_function, Spy().another_function] registrar.register(function_list) for function in function_list: expect(function).to(have_been_called.once) with it('should add a function list to the dictionary of streams to functions' ): stream = Mock() function_list = [Spy().a_function, Spy().another_function] expect_(stream)(*function_list) for function in function_list: expect(function).to_not(have_been_called) expect(len(registrar.stream_to_testers[stream])).to( equal(len(function_list))) with it('should merge multiple function lists if applied to the same stream' ): stream = Mock()