本文整理汇总了Python中utilities.run_all函数的典型用法代码示例。如果您正苦于以下问题:Python run_all函数的具体用法?Python run_all怎么用?Python run_all使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run_all函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: eq_
eq_(e.miny, 50)
eq_(e.maxx, 250)
eq_(e.maxy, 250)
c = e.center()
eq_(c.x, 150)
eq_(c.y, 150)
def test_envelope_clipping():
e1 = mapnik.Box2d(-180,-90,180,90)
e2 = mapnik.Box2d(-120,40,-110,48)
e1.clip(e2)
eq_(e1,e2)
# madagascar in merc
e1 = mapnik.Box2d(4772116.5490, -2744395.0631, 5765186.4203, -1609458.0673)
e2 = mapnik.Box2d(5124338.3753, -2240522.1727, 5207501.8621, -2130452.8520)
e1.clip(e2)
eq_(e1,e2)
# nz in lon/lat
e1 = mapnik.Box2d(163.8062, -47.1897, 179.3628, -33.9069)
e2 = mapnik.Box2d(173.7378, -39.6395, 174.4849, -38.9252)
e1.clip(e2)
eq_(e1,e2)
if __name__ == "__main__":
exit(run_all(eval(x) for x in dir() if x.startswith("test_")))
示例2: eq_
feat = fs.next()
eq_(feat.id(),1)
eq_(feat['name'],'test point')
geoms = feat.geometries()
eq_(len(geoms),1)
eq_(geoms.to_wkt(),'Point(-122 48)')
del ds
# ensure it matches data read with just sqlite
conn = sqlite3.connect(test_db)
cur = conn.cursor()
cur.execute('''SELECT * from point_table''')
conn.commit()
result = cur.fetchone()
cur.close()
feat_id = result[0]
eq_(feat_id,1)
name = result[2]
eq_(name,'test point')
geom_wkb_blob = result[1]
eq_(str(geom_wkb_blob),geoms.to_wkb(mapnik.wkbByteOrder.NDR))
new_geom = mapnik.Path.from_wkb(str(geom_wkb_blob))
eq_(new_geom.to_wkt(),geoms.to_wkt())
conn.close()
os.unlink(test_db)
if __name__ == "__main__":
setup()
returncode = run_all(eval(x) for x in dir() if x.startswith("test_"))
exit(returncode)
示例3: eq_
eq_(hexlify(im.view( 8, 3,1,1).tostring()), hex_v);
eq_(hexlify(im.view(13, 3,1,1).tostring()), hex_v);
eq_(hexlify(im.view( 3, 8,1,1).tostring()), hex_v);
eq_(hexlify(im.view( 8, 8,1,1).tostring()), hex_v);
eq_(hexlify(im.view(13, 8,1,1).tostring()), hex_a);
eq_(hexlify(im.view( 3,13,1,1).tostring()), hex_v);
eq_(hexlify(im.view( 8,13,1,1).tostring()), hex_b);
eq_(hexlify(im.view(13,13,1,1).tostring()), hex_v);
def test_rgba_8bui_subquery():
_test_rgba_subquery('rgba_8bui_subquery', '8BUI', 255, 0, 0, 255, 255, 255)
#def test_rgba_16bui_subquery():
# _test_rgba_subquery('rgba_16bui_subquery', '16BUI', 65535, 0, 0, 65535, 65535, 65535)
#def test_rgba_32bui_subquery():
# _test_rgba_subquery('rgba_32bui_subquery', '32BUI')
atexit.register(postgis_takedown)
def enabled(tname):
enabled = len(sys.argv) < 2 or tname in sys.argv
if not enabled:
print "Skipping " + tname + " as not explicitly enabled"
return enabled
if __name__ == "__main__":
setup()
fail = run_all(eval(x) for x in dir() if x.startswith("test_") and enabled(x))
exit(fail)
示例4: test1
# note: the osm_id should be declared INTEGER PRIMARY KEY
# but in this case we intentionally do not make this a valid pkey
# otherwise sqlite would turn the null into a valid, serial id
ds = mapnik.SQLite(
file=":memory:",
table="test1",
initdb="""
create table test1 (osm_id INTEGER,geometry BLOB);
insert into test1 values (null,x'%s');
"""
% wkb,
extent="-180,-60,180,60",
use_spatial_index=False,
key_field="osm_id",
)
fs = ds.featureset()
feature = None
try:
feature = fs.next()
except StopIteration:
pass
eq_(feature, None)
mapnik.logger.set_severity(default_logging_severity)
if __name__ == "__main__":
setup()
result = run_all(eval(x) for x in dir() if x.startswith("test_"))
teardown()
exit(result)