-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update and extend tests for Py3 and Py2
- Loading branch information
Showing
5 changed files
with
103 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import sys | ||
if sys.version_info.major == 3: | ||
from arc_utils import aprx | ||
|
||
def test_aprxobj_properties(testaprx): | ||
aprxobj = aprx.AprxObj(testaprx) | ||
assert aprxobj.path == testaprx | ||
assert aprxobj.maps[0].name == 'Map' | ||
assert aprxobj.layouts[0].name == 'MyLayout' | ||
|
||
|
||
def test_aprxobj_layer_names(testaprx): | ||
aprxobj = aprx.AprxObj(testaprx) | ||
assert aprxobj.get_layer_names_as_array(aprxobj.maps[0]) == ['test_fc', 'Topographic'] | ||
|
||
|
||
def test_aprxobj_layer_obj(testaprx): | ||
aprxobj = aprx.AprxObj(testaprx) | ||
map_layer_obj = aprxobj.get_layer_obj_as_array(aprxobj.maps[0]) | ||
assert isinstance(map_layer_obj, list) | ||
assert map_layer_obj[0].name == 'test_fc' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
from arc_utils import gdb | ||
|
||
testgdb = r"C:\Temp\scriptTesting\domain_test.gdb" | ||
def test_gdb_properties(testdatabase): | ||
gdbpath = testdatabase.gdb | ||
gdbobj = gdb.GDBObj(gdbpath) | ||
assert gdbobj.path == gdbpath | ||
assert isinstance(gdbobj.feature_classes, list) | ||
assert isinstance(gdbobj.domain_names, list) | ||
|
||
def test_gdb_content(testdatabase): | ||
gdbpath = testdatabase.gdb | ||
gdbobj = gdb.GDBObj(gdbpath) | ||
assert sorted(gdbobj.get_feature_class_names()) == ['test_fc', 'test_fc2'] | ||
assert sorted(gdbobj.get_all_domain_names()) == ['fint_range', 'ftext_coded'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from arc_utils import mxd | ||
import sys | ||
if sys.version_info.major == 2: | ||
from arc_utils import mxd | ||
|
||
|
||
def test_mxdobj_properties(testmxd): | ||
mxdpath = testmxd | ||
mxdobj = mxd.MxdObj(mxdpath) | ||
assert mxdobj.path == mxdpath | ||
#assert mxdobj.mxd is object | ||
assert mxdobj.layer_names_array == [u'test_fc'] | ||
assert isinstance(mxdobj.layer_obj_array, list) | ||
def test_mxdobj_properties(testmxd): | ||
mxdpath = testmxd | ||
mxdobj = mxd.MxdObj(mxdpath) | ||
assert mxdobj.path == mxdpath | ||
#assert mxdobj.mxd is object | ||
assert mxdobj.layer_names_array == [u'test_fc'] | ||
assert isinstance(mxdobj.layer_obj_array, list) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters