<s> import unittest <EOL> from robotide . validators import TimeoutValidator <EOL> class TimeoutValidationTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . validator = TimeoutValidator ( ) <EOL> self . validator . _set_window_value = self . _catch_value <EOL> self . _value = "<STR_LIT>" <EOL> def _catch_value ( self , value ) : <EOL> self . _value = value <EOL> def test_timeout_validation_passes ( self ) : <EOL> result = self . validator . _validate ( "<STR_LIT>" ) <EOL> self . assertEqual ( result , None , "<STR_LIT>" % result ) <EOL> def test_timeout_validation_negative_cases ( self ) : <EOL> self . _run_validation ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:0>" ) <EOL> def test_timeout_validation_illegal_format ( self ) : <EOL> self . _run_validation ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> def _run_validation ( self , * test_values ) : <EOL> errors = [ ] <EOL> for val in test_values : <EOL> result = self . validator . _validate ( val ) <EOL> if result == None : <EOL> errors . append ( "<STR_LIT>" % ( val , result ) ) <EOL> self . assertEqual ( len ( errors ) , <NUM_LIT:0> , '<STR_LIT>' . join ( errors ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
