当前位置: 首页>>代码示例>>Python>>正文


Python utilities.run_all函数代码示例

本文整理汇总了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_")))
开发者ID:MapQuest,项目名称:mapnik,代码行数:30,代码来源:box2d_test.py

示例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)
开发者ID:1060460048,项目名称:mapnik,代码行数:30,代码来源:sqlite_rtree_test.py

示例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)
开发者ID:detlevn,项目名称:mapnik,代码行数:30,代码来源:pgraster_test.py

示例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)
开发者ID:sebastic,项目名称:python-mapnik,代码行数:30,代码来源:sqlite_test.py


注:本文中的utilities.run_all函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。