Esempio n. 1
0
def test_load_process():
    
    try:    
        process = load_process('simple_process')
    except RuntimeError:
        pass
    
    try:    
        process = load_process('examples.simple_process')
    except RuntimeError:
        pass
    
    assert load_process('tests.processes.simple_process.SimpleProcess').__name__ == 'SimpleProcess'
    assert load_process('tests.processes.few_simple_process.SimpleProcess1').__name__ == 'SimpleProcess1'
    assert load_process('tests.processes.few_simple_process.SimpleProcess2').__name__ == 'SimpleProcess2'
Esempio n. 2
0
def test_service_start():
    process = pyservice.load_process(
        'tests.processes.simple_process.SimpleProcess')
    service = pyservice.Service(process)
    service.start()
    assert process <> None, process
    assert service <> None, service
Esempio n. 3
0
def test_service_stop():
    time.sleep(2)
    process = pyservice.load_process('tests.processes.simple_process.SimpleProcess')
    service = pyservice.Service(process)
    service.stop()
    assert process <> None, process
    assert service <> None, service
Esempio n. 4
0
 def test_run_process1(self):
     process1 = pyservice.load_process('tests.processes.few_simple_process.SimpleProcess1')
     service1 = pyservice.Service(process1)
     service1.start()
Esempio n. 5
0
 def test_run_process1(self):
     process2 = pyservice.load_process(
         'tests.processes.few_simple_process.SimpleProcess2')
     service2 = pyservice.Service(process2)
     service2.start()
Esempio n. 6
0
 def test_run_process1(self):
     process2 = pyservice.load_process("tests.processes.few_simple_process.SimpleProcess2")
     service2 = pyservice.Service(process2)
     service2.start()