<s> import arcpy <EOL> import os <EOL> import sys <EOL> import traceback <EOL> import TestUtilities <EOL> def RunTest ( ) : <EOL> try : <EOL> arcpy . AddMessage ( "<STR_LIT>" ) <EOL> if arcpy . CheckExtension ( "<STR_LIT>" ) == "<STR_LIT>" : <EOL> arcpy . CheckOutExtension ( "<STR_LIT>" ) <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> print "<STR_LIT>" <EOL> TestUtilities . createScratch ( ) <EOL> inputPointsFC = os . path . join ( TestUtilities . inputGDB , "<STR_LIT>" ) <EOL> inputSurface = os . path . join ( TestUtilities . inputGDB , "<STR_LIT>" ) <EOL> outputRangeFansFC = os . path . join ( TestUtilities . outputGDB , "<STR_LIT>" ) <EOL> outputRangeVizFC = os . path . join ( TestUtilities . outputGDB , "<STR_LIT>" ) <EOL> toolbox = TestUtilities . toolbox <EOL> sr = arcpy . SpatialReference ( <NUM_LIT> ) <EOL> objects2Check = [ ] <EOL> objects2Check . extend ( [ inputPointsFC , inputSurface , toolbox ] ) <EOL> for object2Check in objects2Check : <EOL> desc = arcpy . Describe ( object2Check ) <EOL> if desc == None : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> else : <EOL> print ( "<STR_LIT>" + desc . Name ) <EOL> print ( "<STR_LIT>" + str ( TestUtilities . currentPath ) ) <EOL> print ( "<STR_LIT>" + str ( TestUtilities . geodatabasePath ) ) <EOL> arcpy . env . overwriteOutput = True <EOL> arcpy . env . scratchWorkspace = TestUtilities . scratchGDB <EOL> arcpy . ImportToolbox ( toolbox , "<STR_LIT>" ) <EOL> inputFeatureCount = int ( arcpy . GetCount_management ( inputPointsFC ) . getOutput ( <NUM_LIT:0> ) ) <EOL> print ( "<STR_LIT>" + str ( inputPointsFC ) ) <EOL> print ( "<STR_LIT>" + str ( inputFeatureCount ) ) <EOL> if ( inputFeatureCount < <NUM_LIT:1> ) : <EOL> print ( "<STR_LIT>" + str ( inputFeatureCount ) ) <EOL> maximumRange = <NUM_LIT> <EOL> bearing = <NUM_LIT> <EOL> traversal = <NUM_LIT> <EOL> arcpy . RangeFan_VandR ( inputPointsFC , maximumRange , bearing , traversal , inputSurface , outputRangeFansFC , outputRangeVizFC , sr ) <EOL> outputFeatureCountFans = int ( arcpy . GetCount_management ( outputRangeFansFC ) . getOutput ( <NUM_LIT:0> ) ) <EOL> print ( "<STR_LIT>" + str ( outputRangeFansFC ) ) <EOL> print ( "<STR_LIT>" + str ( outputFeatureCountFans ) ) <EOL> outputFeatureCountViz = int ( arcpy . GetCount_management ( outputRangeVizFC ) . getOutput ( <NUM_LIT:0> ) ) <EOL> print ( "<STR_LIT>" + str ( outputRangeVizFC ) ) <EOL> print ( "<STR_LIT>" + str ( outputFeatureCountViz ) ) <EOL> if ( outputFeatureCountFans < <NUM_LIT:1> ) or ( outputFeatureCountViz < <NUM_LIT:1> ) : <EOL> print ( "<STR_LIT>" + str ( outputFeatureCountFans ) + "<STR_LIT::>" + str ( outputFeatureCountViz ) ) <EOL> raise Exception ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> TestUtilities . deleteScratch ( ) <EOL> print ( "<STR_LIT>" ) <EOL> except arcpy . ExecuteError : <EOL> msgs = arcpy . GetMessages ( ) <EOL> arcpy . AddError ( msgs ) <EOL> sys . exit ( - <NUM_LIT:1> ) <EOL> except Exception as e : <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> sys . exit ( - <NUM_LIT:1> ) <EOL> finally : <EOL> arcpy . CheckInExtension ( "<STR_LIT>" ) <EOL> RunTest ( ) </s>
