forked from knu2xs/forestry-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
55 lines (44 loc) · 1.6 KB
/
test.py
File metadata and controls
55 lines (44 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""
Unit testing
"""
import unittest
import os.path
import arcpy
import forestryTools
class TestUsingLocalData(unittest.TestCase):
# useful variables
dirThis = os.path.dirname(__file__)
lyrStnds = os.path.join(dirThis, 'resources', 'StandsInventory.lyr')
gdbSrtch = os.path.join(dirThis, 'resources', 'test_data.gdb')
# overwrite previous outputs if they exist
arcpy.env.overwriteOutput = True
def test_random150by150_defaultUnits(self):
forestryTools.postPointsByDimensionRandom(
inputFeatures=self.lyrStnds,
xGridSpacing=150,
yGridSpacing=150,
outputFeatureClass=os.path.join(self.gdbSrtch, 'random150by150default')
)
def test_random6by6_chains(self):
forestryTools.postPointsByDimensionRandom(
inputFeatures=self.lyrStnds,
xGridSpacing=6,
yGridSpacing=6,
outputFeatureClass=os.path.join(self.gdbSrtch, 'random6by6chains'),
inputUnitMeasure='Chains'
)
def test_regular150by150_defaultUnits(self):
forestryTools.postPointsByDimension(
inputFeatures=self.lyrStnds,
xGridSpacing=150,
yGridSpacing=150,
outputFeatureClass=os.path.join(self.gdbSrtch, 'regular150by150default')
)
def test_regular6by6_chains(self):
forestryTools.postPointsByDimensionRandom(
inputFeatures=self.lyrStnds,
xGridSpacing=6,
yGridSpacing=6,
outputFeatureClass=os.path.join(self.gdbSrtch, 'regular6by6chains'),
inputUnitMeasure='Chains'
)