def test_out_of_order(self): # This demonstrates that we notice out-of-order IO with self.assertRaisesRegexp(AssertionError, "'Loop 2' not found"): with assertSequentialStdout(self.proc_output, dut_process) as cm: cm.assertInStdout('Loop 1') cm.assertInStdout('Loop 3') cm.assertInStdout('Loop 2') # This should raise
def test_out_of_order(self, proc_output, roudi_process): with assertSequentialStdout(proc_output, roudi_process) as cm: cm.assertInStdout('Log level set to:') cm.assertInStdout('[ Reserving shared memory successful ]') cm.assertInStdout('Registered memory segment') cm.assertInStdout('[ Reserving shared memory successful ]') cm.assertInStdout('Roudi registered payload data segment') cm.assertInStdout('RouDi is ready for clients')
def test_full_output(self, dut): # Same as the test_process_output test. launch_testing binds the value of # 'dut' from the test_context to the test before it runs with assertSequentialStdout(self.proc_output, process=dut) as cm: cm.assertInStdout('Starting Up') if os.name != 'nt': # On Windows, process termination is always forced # and thus the last print in good proc never makes it. cm.assertInStdout('Shutting Down')
def test_full_output(self, proc_output, roudi_process): with assertSequentialStdout(proc_output, roudi_process) as cm: cm.assertInStdout('Log level set to:') cm.assertInStdout('RouDi is ready for clients') if os.name != 'nt': cm.assertInStdout("Joining 'Mon+Discover' thread...") cm.assertInStdout("...'Mon+Discover' thread joined.") cm.assertInStdout("Joining 'IPC-msg-process' thread...") cm.assertInStdout("...'IPC-msg-process' thread joined.")
def test_full_output(self): # Using the SequentialStdout context manager asserts that the following stdout # happened in the same order that it's checked with assertSequentialStdout(self.proc_output, dut_process) as cm: cm.assertInStdout('Starting Up') for n in range(4): cm.assertInStdout('Loop {}'.format(n)) if os.name != 'nt': # On Windows, process termination is always forced # and thus the last print in good_proc never makes it. cm.assertInStdout('Shutting Down')
def test_full_output(self, proc_output, roudi_process): with assertSequentialStdout(proc_output, roudi_process) as cm: cm.assertInStdout('Log level set to:') cm.assertInStdout('[ Reserving shared memory successful ]') cm.assertInStdout('Registered memory segment') cm.assertInStdout('[ Reserving shared memory successful ]') cm.assertInStdout('Roudi registered payload data segment') cm.assertInStdout('RouDi is ready for clients') if os.name != 'nt': cm.assertInStdout("Joining 'Mon+Discover' thread...") cm.assertInStdout("...'Mon+Discover' thread joined.") cm.assertInStdout("Joining 'IPC-msg-process' thread...") cm.assertInStdout("...'IPC-msg-process' thread joined.")
def test_out_of_order(self, proc_output, roudi_process): with assertSequentialStdout(proc_output, roudi_process) as cm: cm.assertInStdout('Log level set to:') cm.assertInStdout('RouDi is ready for clients')