def test_gdalinfo_lib_3(): ds = gdal.Open('../gdrivers/data/nitf/fake_nsif.ntf') ret = gdal.Info(ds, format='json') assert 'TRE' not in ret['metadata'], 'got unexpected extra MD.' options = gdal.InfoOptions(format='json', extraMDDomains=['TRE']) ret = gdal.Info(ds, options=options) assert ret['metadata']['TRE']['BLOCKA'].find('010000001000000000') != -1, \ 'did not get extra MD.'
def test_gdalinfo_lib_3(): ds = gdal.Open('../gdrivers/data/fake_nsif.ntf') ret = gdal.Info(ds, format='json') if 'TRE' in ret['metadata']: gdaltest.post_reason('got unexpected extra MD.') print(ret) return 'fail' options = gdal.InfoOptions(format='json', extraMDDomains=['TRE']) ret = gdal.Info(ds, options=options) if ret['metadata']['TRE']['BLOCKA'].find('010000001000000000') == -1: gdaltest.post_reason('did not get extra MD.') print(ret) return 'fail' return 'success'