Exemplo n.º 1
0
def test_run_1():
    parser = Parser(overall)
    cmds = parser.consume()[:1]
    
    pipeline = Runtime(cmds, JOB_TYPES, 'mock', sleep_time=0.01)
    iters = pipeline.run()
    iters.should.equal(1)
Exemplo n.º 2
0
def test_max_concurrent_jobs():
    parser = Parser(concurrent)
    cmds = parser.consume()

    pipeline = Runtime(cmds, ReportingJobQueue, { 'local': MockJob }, 'local', sleep_time=0.01)
    iters = pipeline.run()
    iters.should.be.greater_than(30)
Exemplo n.º 3
0
def test_run_11():
    parser = Parser(overall)
    cmds = parser.consume()[:11]

    pipeline = Runtime(cmds, ReportingJobQueue, JOB_TYPES, 'mock', sleep_time=0.01)
    iters = pipeline.run()
    iters.should.be.greater_than(15)
Exemplo n.º 4
0
def test_run_10():
    parser = Parser(overall)
    cmds = parser.consume()[:10]

    pipeline = Runtime(cmds, ReportingJobQueue, JOB_TYPES, 'mock', sleep_time=0.01)
    iters = pipeline.run()
    iters.should.equal(23)
Exemplo n.º 5
0
def test_get_new_commands_8():
    parser = Parser(overall)
    cmds = parser.consume()[:8]

    pipeline = Runtime(cmds, JOB_TYPES, 'mock')
    new = pipeline._get_new_commands()
    print(new)
    new.should.have.length_of(11)    
Exemplo n.º 6
0
def test_max_concurrent_jobs():
    parser = Parser(concurrent)
    cmds = parser.consume()

    pipeline = Runtime(cmds,
                       ReportingJobQueue, {'local': MockJob},
                       'local',
                       sleep_time=0.01)
    iters = pipeline.run()
    iters.should.be.greater_than(30)
Exemplo n.º 7
0
def test_run_11():
    parser = Parser(overall)
    cmds = parser.consume()[:11]

    pipeline = Runtime(cmds,
                       ReportingJobQueue,
                       JOB_TYPES,
                       'mock',
                       sleep_time=0.01)
    iters = pipeline.run()
    iters.should.be.greater_than(15)
Exemplo n.º 8
0
def test_run_10():
    parser = Parser(overall)
    cmds = parser.consume()[:10]

    pipeline = Runtime(cmds,
                       ReportingJobQueue,
                       JOB_TYPES,
                       'mock',
                       sleep_time=0.01)
    iters = pipeline.run()
    iters.should.equal(25)
Exemplo n.º 9
0
def test_get_new_commands_9():
    parser = Parser(overall)
    cmds = parser.consume()[:9]

    pipeline = Runtime(cmds, ReportingJobQueue, JOB_TYPES, 'mock')
    new = pipeline.queue.queue
    new.should.have.length_of(9)