<s> import arcpy <EOL> import sys <EOL> import traceback <EOL> import TestUtilities <EOL> import os <EOL> class LicenseError ( Exception ) : <EOL> pass <EOL> try : <EOL> if arcpy . CheckExtension ( "<STR_LIT>" ) == "<STR_LIT>" : <EOL> arcpy . CheckOutExtension ( "<STR_LIT>" ) <EOL> else : <EOL> raise LicenseError <EOL> arcpy . ImportToolbox ( TestUtilities . toolbox ) <EOL> arcpy . env . overwriteOutput = True <EOL> inputDriveTimeStartPoint = os . path . join ( TestUtilities . inputGDB , "<STR_LIT>" ) <EOL> inputDriveTimeValue = "<STR_LIT>" <EOL> inputDriveTimeUnit = "<STR_LIT>" <EOL> inputPointBarrier = "<STR_LIT:#>" <EOL> inputLineBarrier = "<STR_LIT:#>" <EOL> inputPolygonBarrier = "<STR_LIT:#>" <EOL> psOutput = os . path . join ( TestUtilities . outputGDB , "<STR_LIT>" ) <EOL> arcpy . AddMessage ( "<STR_LIT>" ) <EOL> arcpy . DriveTime_pubtask ( inputDriveTimeStartPoint , inputDriveTimeValue , inputDriveTimeUnit , inputPointBarrier , inputLineBarrier , inputPolygonBarrier , psOutput ) <EOL> outputFeatureCount = int ( arcpy . GetCount_management ( psOutput ) . getOutput ( <NUM_LIT:0> ) ) <EOL> print ( "<STR_LIT>" + str ( psOutput ) ) <EOL> print ( "<STR_LIT>" + str ( outputFeatureCount ) ) <EOL> if ( outputFeatureCount < <NUM_LIT:1> ) : <EOL> print ( "<STR_LIT>" + str ( outputFeatureCount ) ) <EOL> raise Exception ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> except LicenseError : <EOL> print ( "<STR_LIT>" ) <EOL> except arcpy . ExecuteError : <EOL> msgs = arcpy . GetMessages ( ) <EOL> arcpy . AddError ( msgs ) <EOL> print ( msgs ) <EOL> sys . exit ( - <NUM_LIT:1> ) <EOL> except : <EOL> tb = sys . exc_info ( ) [ <NUM_LIT:2> ] <EOL> tbinfo = traceback . format_tb ( tb ) [ <NUM_LIT:0> ] <EOL> pymsg = "<STR_LIT>" + tbinfo + "<STR_LIT>" + str ( sys . exc_info ( ) [ <NUM_LIT:1> ] ) <EOL> msgs = "<STR_LIT>" + arcpy . GetMessages ( ) + "<STR_LIT:\n>" <EOL> arcpy . AddError ( pymsg ) <EOL> arcpy . AddError ( msgs ) <EOL> print ( pymsg + "<STR_LIT:\n>" ) <EOL> print ( msgs ) <EOL> sys . exit ( - <NUM_LIT:1> ) <EOL> finally : <EOL> if arcpy . CheckExtension ( "<STR_LIT>" ) == "<STR_LIT>" : <EOL> arcpy . CheckInExtension ( "<STR_LIT>" ) </s>
