def test_sequence_files(self): "Simple test for error handling of an unknown sequence file" cmd_str = "NAME,PMTreadoutgibtsnit.py;CYCLES,1;TRIGGER,YES;" my_main_program = main_program.MainProgram() return_var = my_main_program.execute_program(cmd_str) if not return_var.is_error: self.fail("server should raise an error message here")
def test_bichro_pulse(self): """Test the bichromatic pulse This test checks only if the server runs without an error There is no real functionality check in here""" cmd_str = generate_cmd_str("test_bichro_sequence.py", nr_of_car=5) my_main_program = main_program.MainProgram() return_var = my_main_program.execute_program(cmd_str) if return_var.is_error: self.fail(return_var.return_string)
def test_nr_carrier_many(self): """Test how many transitions the server can handle This program uses too many transitions and should therefore raise an error message """ cmd_str = generate_cmd_str("test_sequence_many.py", nr_of_car=9) my_main_program = main_program.MainProgram() return_var = my_main_program.execute_program(cmd_str) if not return_var.is_error: self.fail("The server should return an error but it does not: " + str(return_var.return_string))
def test_nr_carrier_nr(self): """"Test how many transitions the server can initialize without using them This should run without an error """ cmd_str = generate_cmd_str("test_sequence.py", nr_of_car=9) my_main_program = main_program.MainProgram() return_var = my_main_program.execute_program(cmd_str) print("return string: " + return_var.return_string) if return_var.is_error: self.fail(return_var.return_string) assert (return_var.return_string == "test, Juhu;sequence_duration,2000.95;")
#!/usr/bin/env python # -*- mode: Python; coding: latin-1 -*- # Time-stamp: "2008-08-13 09:35:52 c704271" # file test_sequencer2_server.py # copyright (c) Philipp Schindler 2008 # url http://pulse-sequencer.sf.net import logging from sequencer2 import ptplog from server import main_program logger = ptplog.ptplog(level=logging.DEBUG) main_program = main_program.MainProgram() main_program.start_server() # test_sequencer2_server.py ends here
def test_execute_program(self): cmd_str = generate_cmd_str("test_sequence.py", nr_of_car=2) my_main_program = main_program.MainProgram() return_var = my_main_program.execute_program(cmd_str) if return_var.is_error: self.fail(return_var.return_string)