<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> import unittest <EOL> import subprocess <EOL> import server as server <EOL> class ClientHelperMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> def runClientCmd ( self , client , command , arguments = "<STR_LIT>" ) : <EOL> try : <EOL> client . runCommand ( command , arguments ) <EOL> except subprocess . CalledProcessError as error : <EOL> self . server . printDebugInfo ( ) <EOL> raise error <EOL> class ServerTest ( ClientHelperMixin , unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def otherSetup ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def otherExceptionHandling ( self ) : <EOL> pass <EOL> def otherTeardown ( self ) : <EOL> pass <EOL> def getServer ( self ) : <EOL> return server . Ga4ghServerForTesting ( ) <EOL> def run ( self , * args , ** kwargs ) : <EOL> self . otherSetup ( ) <EOL> self . server = self . getServer ( ) <EOL> try : <EOL> self . server . start ( ) <EOL> super ( ServerTest , self ) . run ( * args , ** kwargs ) <EOL> except Exception as exception : <EOL> self . server . printDebugInfo ( ) <EOL> self . otherExceptionHandling ( ) <EOL> raise exception <EOL> finally : <EOL> self . server . shutdown ( ) <EOL> self . otherTeardown ( ) <EOL> class ServerTestClass ( ClientHelperMixin , unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> cls . otherSetup ( ) <EOL> cls . server = cls . getServer ( ) <EOL> cls . server . start ( ) <EOL> @ classmethod <EOL> def tearDownClass ( cls ) : <EOL> cls . server . shutdown ( ) <EOL> cls . otherTeardown ( ) <EOL> @ classmethod <EOL> def otherSetup ( cls ) : <EOL> pass <EOL> @ classmethod <EOL> def otherTeardown ( cls ) : <EOL> pass <EOL> @ classmethod <EOL> def otherExceptionHandling ( cls ) : <EOL> pass <EOL> @ classmethod <EOL> def getServer ( cls ) : <EOL> return server . Ga4ghServerForTesting ( ) <EOL> def run ( self , * args , ** kwargs ) : <EOL> try : <EOL> super ( ServerTestClass , self ) . run ( * args , ** kwargs ) <EOL> except Exception as exception : <EOL> self . server . printDebugInfo ( ) <EOL> self . otherExceptionHandling ( ) <EOL> raise exception </s>
