<s> import sys <EOL> import unittest <EOL> sys . path . append ( '<STR_LIT>' ) <EOL> from client_test_lib import Bootstrap , ActionFailureTest <EOL> from client_test_lib import get_action , random_string <EOL> from client_test_lib import startup_config_action <EOL> from client_test_lib import raise_exception <EOL> class FailureTest ( ActionFailureTest ) : <EOL> def test_missing_smarthost ( self ) : <EOL> self . basic_test ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def test_missing_sender ( self ) : <EOL> self . basic_test ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> attributes = { '<STR_LIT>' : <EOL> random_string ( ) } ) <EOL> def test_missing_receivers ( self ) : <EOL> self . basic_test ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> attributes = { '<STR_LIT>' : <EOL> random_string ( ) , <EOL> '<STR_LIT>' : <EOL> random_string ( ) } ) <EOL> class SuccessTest ( unittest . TestCase ) : <EOL> def test_success ( self ) : <EOL> bootstrap = Bootstrap ( ztps_default_config = True ) <EOL> smarthost = "<STR_LIT>" % str ( bootstrap . server ) . split ( '<STR_LIT::>' ) [ <NUM_LIT:0> ] <EOL> bootstrap . ztps . set_definition_response ( <EOL> actions = [ { '<STR_LIT:action>' : '<STR_LIT>' } , <EOL> { '<STR_LIT:action>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : smarthost , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] } } ] ) <EOL> bootstrap . ztps . set_action_response ( '<STR_LIT>' , <EOL> startup_config_action ( ) ) <EOL> action = get_action ( '<STR_LIT>' ) <EOL> bootstrap . ztps . set_action_response ( '<STR_LIT>' , <EOL> action ) <EOL> bootstrap . start_test ( ) <EOL> try : <EOL> self . failUnless ( bootstrap . success ( ) ) <EOL> except Exception as exception : <EOL> print '<STR_LIT>' % bootstrap . output <EOL> print '<STR_LIT>' % bootstrap . error <EOL> raise_exception ( exception ) <EOL> finally : <EOL> bootstrap . end_test ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
