<s> import unittest <EOL> import arcpy <EOL> import os <EOL> import UnitTestUtilities <EOL> import Configuration <EOL> import DataDownload <EOL> class IncidentDensityTestCase ( unittest . TestCase ) : <EOL> '''<STR_LIT>''' <EOL> inputPointFeatures = None <EOL> inputBoundaryFeatures = None <EOL> def setUp ( self ) : <EOL> if Configuration . DEBUG == True : print ( "<STR_LIT>" ) <EOL> UnitTestUtilities . checkArcPy ( ) <EOL> Configuration . incidentDataPath = DataDownload . runDataDownload ( Configuration . patternsPaths , Configuration . incidentGDBName , Configuration . incidentURL ) <EOL> if ( Configuration . incidentScratchGDB == None ) or ( not arcpy . Exists ( Configuration . incidentScratchGDB ) ) : <EOL> Configuration . incidentScratchGDB = UnitTestUtilities . createScratch ( Configuration . incidentDataPath ) <EOL> Configuration . incidentInputGDB = os . path . join ( Configuration . incidentDataPath , Configuration . incidentGDBName ) <EOL> UnitTestUtilities . checkFilePaths ( [ Configuration . incidentDataPath , Configuration . incidentInputGDB , Configuration . patterns_ProToolboxPath , Configuration . patterns_DesktopToolboxPath ] ) <EOL> if ( Configuration . incidentScratchGDB == None ) or ( not arcpy . Exists ( Configuration . incidentScratchGDB ) ) : <EOL> Configuration . incidentScratchGDB = UnitTestUtilities . createScratch ( Configuration . incidentDataPath ) <EOL> self . inputPointFeatures = os . path . join ( Configuration . incidentInputGDB , "<STR_LIT>" ) <EOL> self . inputBoundaryFeatures = os . path . join ( Configuration . incidentInputGDB , "<STR_LIT>" ) <EOL> def tearDown ( self ) : <EOL> if Configuration . DEBUG == True : print ( "<STR_LIT>" ) <EOL> UnitTestUtilities . deleteScratch ( Configuration . incidentScratchGDB ) <EOL> def test_incident_density_pro ( self ) : <EOL> if Configuration . DEBUG == True : print ( "<STR_LIT>" ) <EOL> arcpy . AddMessage ( "<STR_LIT>" ) <EOL> self . test_incident_density ( Configuration . patterns_ProToolboxPath ) <EOL> def test_incident_density_desktop ( self ) : <EOL> if Configuration . DEBUG == True : print ( "<STR_LIT>" ) <EOL> arcpy . AddMessage ( "<STR_LIT>" ) <EOL> self . test_incident_density ( Configuration . patterns_DesktopToolboxPath ) <EOL> def test_incident_density ( self , toolboxPath ) : <EOL> try : <EOL> if Configuration . DEBUG == True : print ( "<STR_LIT>" ) <EOL> arcpy . CheckOutExtension ( "<STR_LIT>" ) <EOL> arcpy . ImportToolbox ( toolboxPath , "<STR_LIT>" ) <EOL> runToolMsg = "<STR_LIT>" <EOL> arcpy . AddMessage ( runToolMsg ) <EOL> Configuration . Logger . info ( runToolMsg ) <EOL> outputDensity = os . path . join ( Configuration . incidentScratchGDB , "<STR_LIT>" ) <EOL> arcpy . IncidentDensity_iaTools ( self . inputPointFeatures , self . inputBoundaryFeatures , outputDensity ) <EOL> arcpy . CheckInExtension ( "<STR_LIT>" ) <EOL> self . assertTrue ( arcpy . Exists ( outputDensity ) ) <EOL> except arcpy . ExecuteError : <EOL> UnitTestUtilities . handleArcPyError ( ) <EOL> except : <EOL> UnitTestUtilities . handleGeneralError ( ) </s>
