layer.close() layer.close() # discard resultset. return 'success' ############################################################################### # Cleanup. def ogr_query_cleanup(): pmstestlib.layer = None pmstestlib.map = None return 'success' test_list = [ ogr_query_1, ogr_query_2, ogr_query_3, ogr_query_4, ogr_query_5, ogr_query_6, ogr_query_7, ogr_query_cleanup ] if __name__ == '__main__': pmstestlib.setup_run('ogr_query') pmstestlib.run_tests(test_list) pmstestlib.summarize() mapscript.msCleanup()
############################################################################### # Cleanup. def ogr_query_cleanup(): pmstestlib.layer = None pmstestlib.map = None return "success" test_list = [ ogr_query_1, ogr_query_2, ogr_query_3, ogr_query_4, ogr_query_5, ogr_query_6, ogr_query_7, ogr_query_cleanup, ] if __name__ == "__main__": pmstestlib.setup_run("ogr_query") pmstestlib.run_tests(test_list) pmstestlib.summarize() mapscript.msCleanup(0)
if new_wkt != orig_wkt: pmstestlib.post_reason( 'WKT "%s" converted to "%s".' \ % (orig_wkt, new_wkt) ) return 'fail' return 'success' ############################################################################### # Cleanup. def wkt_test_cleanup(): return 'success' test_list = [ wkt_test_1, wkt_test_2, wkt_test_3, wkt_test_cleanup ] if __name__ == '__main__': pmstestlib.setup_run( 'wkt' ) pmstestlib.run_tests( test_list ) pmstestlib.summarize() mapscript.msCleanup()
pass try: si.pattern = [i for i in range(11)] pmstestlib.post_reason('fail 6') return 'fail' except mapscript.MapServerError, e: pass try: si.patternlength = 0 pmstestlib.post_reason('fail 7') return 'fail' except mapscript.MapServerError, e: pass return 'success' test_list = [bug_673, test_pattern, None] if __name__ == '__main__': pmstestlib.setup_run('bug_check') pmstestlib.run_tests(test_list) pmstestlib.summarize() mapscript.msCleanup(0)
shp = mapscript.shapeObj.fromWKT(orig_wkt) new_wkt = shp.toWKT() if new_wkt != orig_wkt: pmstestlib.post_reason( 'WKT "%s" converted to "%s".' \ % (orig_wkt, new_wkt) ) return 'fail' return 'success' ############################################################################### # Cleanup. def wkt_test_cleanup(): return 'success' test_list = [wkt_test_1, wkt_test_2, wkt_test_3, wkt_test_cleanup] if __name__ == '__main__': pmstestlib.setup_run('wkt') pmstestlib.run_tests(test_list) pmstestlib.summarize() mapscript.msCleanup()
# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. ############################################################################### # # $Log$ # Revision 1.1 2004/05/13 03:01:33 frank # New # # import sys sys.path.append('../pymod') import pmstestlib ############################################################################### # main() if __name__ == '__main__': pmstestlib.setup_run('all') pmstestlib.run_all('.', sys.argv[1:]) errors = pmstestlib.summarize() sys.exit(errors)
si.pattern = [i for i in range(11)] pmstestlib.post_reason('fail 6') return 'fail' except mapscript.MapServerError, e: pass try: si.patternlength = 0 pmstestlib.post_reason('fail 7') return 'fail' except mapscript.MapServerError, e: pass return 'success' test_list = [ bug_673, test_pattern, None ] if __name__ == '__main__': pmstestlib.setup_run( 'bug_check' ) pmstestlib.run_tests( test_list ) pmstestlib.summarize() mapscript.msCleanup(0)
return 'success' ############################################################################### # Cleanup. def ogr_query_cleanup(): pmstestlib.layer = None pmstestlib.map = None return 'success' test_list = [ ogr_query_1, ogr_query_2, ogr_query_3, ogr_query_4, ogr_query_5, ogr_query_6, ogr_query_7, ogr_query_cleanup ] if __name__ == '__main__': pmstestlib.setup_run( 'ogr_query' ) pmstestlib.run_tests( test_list ) pmstestlib.summarize() mapscript.msCleanup()
data.find('xmlns:lightroom="http://ns.adobe.com/lightroom/1.0/"') == -1 or \ data.find('lightroom:PrivateRTKInfo="My Information Here"') == -1 or \ data.find('exif:ExifVersion="dummy"') == -1 or \ data.find('xmp:CreatorTool="MapServer"') == -1 or \ data.find('photoshop:Source="MapServer"') == -1 or \ data.find('crs:Converter="MapServer"') == -1 or \ data.find('x:Author="John Doe"') == -1 : try: from osgeo import gdal ds = gdal.Open('result/test_xmp.png') print(ds.GetMetadata('xml:XMP')) ds = None except: pass return 'fail' return 'success' test_list = [test_xmp, None] if __name__ == '__main__': pmstestlib.setup_run('test_xmp') pmstestlib.run_tests(test_list) pmstestlib.summarize() mapscript.msCleanup(0)
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. ############################################################################### # # $Log$ # Revision 1.1 2004/05/13 03:01:33 frank # New # # import sys sys.path.append( '../pymod' ) import pmstestlib ############################################################################### # main() if __name__ == '__main__': pmstestlib.setup_run( 'all' ) pmstestlib.run_all( '.', sys.argv[1:] ) errors = pmstestlib.summarize() sys.exit(errors)
return 'success' ############################################################################### # Cleanup. def rqtest_cleanup(): pmstestlib.layer = None pmstestlib.map = None return 'success' test_list = [ rqtest_1, rqtest_2, rqtest_3, rqtest_4, rqtest_5, rqtest_6, rqtest_7, rqtest_8, rqtest_9, rqtest_9_1, rqtest_9_2, rqtest_10, rqtest_11, rqtest_12, rqtest_13, rqtest_14, rqtest_15, rqtest_16, rqtest_17, rqtest_cleanup ] if __name__ == '__main__': pmstestlib.setup_run('rqtest') pmstestlib.run_tests(test_list) pmstestlib.summarize() mapscript.msCleanup()
return 'fail' if 'Content-Type' not in headers or headers['Content-Type'] != 'image/png': pmstestlib.post_reason('wrong Content-Type') print(headers) return 'fail' if 'Cache-Control' not in headers or headers[ 'Cache-Control'] != 'max-age=86400': pmstestlib.post_reason('wrong Cache-Control') print(headers) return 'fail' result = mapscript.msIO_getStdoutBufferBytes() if result is None or result[1:4] != b'PNG': pmstestlib.post_reason('wrong data') return 'fail' return 'success' test_list = [test_msIO_getAndStripStdoutBufferMimeHeaders, None] if __name__ == '__main__': pmstestlib.setup_run('test_mapio') pmstestlib.run_tests(test_list) pmstestlib.summarize() mapscript.msCleanup()
rqtest_2, rqtest_3, rqtest_4, rqtest_5, rqtest_6, rqtest_7, rqtest_8, rqtest_9, rqtest_9_1, rqtest_9_2, rqtest_10, rqtest_11, rqtest_12, rqtest_13, rqtest_14, rqtest_15, rqtest_16, rqtest_17, rqtest_cleanup ] if __name__ == '__main__': pmstestlib.setup_run( 'rqtest' ) pmstestlib.run_tests( test_list ) pmstestlib.summarize() mapscript.msCleanup()
data.find('exif:ExifVersion="dummy"') == -1 or \ data.find('xmp:CreatorTool="MapServer"') == -1 or \ data.find('photoshop:Source="MapServer"') == -1 or \ data.find('crs:Converter="MapServer"') == -1 or \ data.find('x:Author="John Doe"') == -1 : try: from osgeo import gdal ds = gdal.Open('result/test_xmp.png') print(ds.GetMetadata('xml:XMP')) ds = None except: pass return 'fail' return 'success' test_list = [ test_xmp, None ] if __name__ == '__main__': pmstestlib.setup_run( 'test_xmp' ) pmstestlib.run_tests( test_list ) pmstestlib.summarize() mapscript.msCleanup(0)