<s> import inspect <EOL> import os <EOL> from os . path import abspath , dirname , exists , join <EOL> builtin_tests = """<STR_LIT>""" <EOL> class PyFrcAddTests : <EOL> def __init__ ( self , parser = None ) : <EOL> pass <EOL> def run ( self , options , robot_class , ** static_options ) : <EOL> robot_file = abspath ( inspect . getfile ( robot_class ) ) <EOL> robot_path = dirname ( robot_file ) <EOL> try_dirs = [ <EOL> abspath ( join ( robot_path , '<STR_LIT>' ) ) , <EOL> abspath ( join ( robot_path , '<STR_LIT:..>' , '<STR_LIT>' ) ) <EOL> ] <EOL> test_directory = try_dirs [ <NUM_LIT:0> ] <EOL> for d in try_dirs : <EOL> if exists ( d ) : <EOL> test_directory = d <EOL> break <EOL> else : <EOL> os . makedirs ( test_directory ) <EOL> print ( "<STR_LIT>" % test_directory ) <EOL> print ( ) <EOL> builtin_tests_file = join ( test_directory , '<STR_LIT>' ) <EOL> if exists ( builtin_tests_file ) : <EOL> print ( '<STR_LIT>' ) <EOL> else : <EOL> with open ( builtin_tests_file , '<STR_LIT:w>' ) as fp : <EOL> fp . write ( builtin_tests ) <EOL> print ( "<STR_LIT>" , builtin_tests_file ) <EOL> print ( ) <EOL> print ( "<STR_LIT>" ) </s>
