<s> import os <EOL> from dccautomation import compat , bootstrap , client , configs <EOL> from . import systemtest_mixins <EOL> def make_client ( ) : <EOL> cfg = configs . CurrentPython ( ) <EOL> proc = bootstrap . start_server_process ( cfg ) <EOL> c = client . Client ( proc ) <EOL> return c <EOL> class IpcSystemTests ( systemtest_mixins . SystemTests , compat . unittest . TestCase ) : <EOL> @ classmethod <EOL> def new_client ( cls ) : <EOL> return make_client ( ) <EOL> def test_is_in_different_proc ( self ) : <EOL> self . client . exec_ ( '<STR_LIT>' ) <EOL> pid = int ( self . client . eval_ ( '<STR_LIT>' ) ) <EOL> self . assertNotEqual ( pid , os . getpid ( ) ) <EOL> class HandshakeTests ( compat . unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . clients = [ make_client ( ) for _ in range ( <NUM_LIT:2> ) ] <EOL> def test_handshake_supports_multiple_procs ( self ) : <EOL> for c in self . clients : <EOL> c . exec_ ( '<STR_LIT>' ) <EOL> self . assertEqual ( <EOL> c . eval_ ( '<STR_LIT>' ) , <EOL> c . serverproc . popen . pid , <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> class HandshakerTests ( compat . unittest . TestCase ) : <EOL> def test_does_not_handshake_if_error_occurred ( self ) : <EOL> with self . assertRaises ( ZeroDivisionError ) : <EOL> with bootstrap . Handshaker ( configs . CurrentPython ( ) , { } ) as h : <EOL> _ = <NUM_LIT:1> / <NUM_LIT:0> <EOL> self . assertIsNone ( h . app_endpoint ) </s>
