<s> import unittest <EOL> import os <EOL> from yaksh . scilab_code_evaluator import ScilabCodeEvaluator <EOL> from yaksh . settings import SERVER_TIMEOUT <EOL> class ScilabEvaluationTestCases ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . language = "<STR_LIT>" <EOL> self . ref_code_path = "<STR_LIT>" <EOL> self . in_dir = "<STR_LIT>" <EOL> self . test_case_data = [ ] <EOL> self . timeout_msg = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) . format ( SERVER_TIMEOUT ) <EOL> self . test = None <EOL> def test_correct_answer ( self ) : <EOL> user_answer = "<STR_LIT>" <EOL> get_class = ScilabCodeEvaluator ( self . test_case_data , self . test , <EOL> self . language , user_answer , <EOL> self . ref_code_path , self . in_dir ) <EOL> result = get_class . evaluate ( ) <EOL> self . assertTrue ( result . get ( "<STR_LIT:success>" ) ) <EOL> self . assertEqual ( result . get ( "<STR_LIT:error>" ) , "<STR_LIT>" ) <EOL> def test_error ( self ) : <EOL> user_answer = "<STR_LIT>" <EOL> get_class = ScilabCodeEvaluator ( self . test_case_data , self . test , <EOL> self . language , user_answer , <EOL> self . ref_code_path , self . in_dir ) <EOL> result = get_class . evaluate ( ) <EOL> self . assertFalse ( result . get ( "<STR_LIT:success>" ) ) <EOL> self . assertTrue ( "<STR_LIT:error>" in result . get ( "<STR_LIT:error>" ) ) <EOL> def test_infinite_loop ( self ) : <EOL> user_answer = "<STR_LIT>" <EOL> get_class = ScilabCodeEvaluator ( self . test_case_data , self . test , <EOL> self . language , user_answer , <EOL> self . ref_code_path , self . in_dir ) <EOL> result = get_class . evaluate ( ) <EOL> self . assertFalse ( result . get ( "<STR_LIT:success>" ) ) <EOL> self . assertEquals ( result . get ( "<STR_LIT:error>" ) , self . timeout_msg ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
