Exemplo n.º 1
0
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))))
Exemplo n.º 2
0
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))
        )
    )
Exemplo n.º 3
0
        thread.join()

        result = queue.get()
        # result is [stream, observer]

        expect(result[0]).to(be(a_stream))
        expect(result[1]).to(be(a_subject))

    with it('should call `run` on every thread passed to the launch_threads function'
            ):
        a_thread = Spy()
        another_thread = Spy()

        threads = [a_thread, another_thread]

        threader.launch_threads(threads)

        for thread in threads:
            expect(thread.start).to(have_been_called.once)

    with it('should call `subscribe` on each of the passed streams'):
        a_stream = Spy()
        another_stream = Spy()

        a_tester = Spy().a_tester
        another_tester = Spy().another_tester

        stream_to_testers = {
            a_stream: [a_tester],
            another_stream: [a_tester, another_tester]
        }
Exemplo n.º 4
0
        result = queue.get()
        # result is [stream, observer]

        expect(result[0]).to(be(a_stream))
        expect(result[1]).to(be(a_subject))

    with it('should call `run` on every thread passed to the launch_threads function'):
        a_thread = Spy()
        another_thread = Spy()

        threads = [
            a_thread,
            another_thread
        ]

        threader.launch_threads(threads)

        for thread in threads:
            expect(thread.start).to(have_been_called.once)

    with it('should call `subscribe` on each of the passed streams'):
        a_stream = Spy()
        another_stream = Spy()

        a_tester = Spy().a_tester
        another_tester = Spy().another_tester

        stream_to_testers = {
            a_stream: [a_tester],
            another_stream: [a_tester, another_tester]
        }