#  tests for fiona-1.8.13.post1-py36hc820daa_0 (this is a generated file);
print('===== testing package: fiona-1.8.13.post1-py36hc820daa_0 =====');
print('running run_test.py');
#  --- run_test.py (begin) ---
import os
import fiona

fname = os.path.join(os.environ['RECIPE_DIR'], 'test_data', 'test.shp')

with fiona.open(fname, 'r') as f:
    assert f.schema['geometry'] == 'Point'

# https://github.com/conda-forge/fiona-feedstock/issues/49
meta = {'driver': 'ESRI Shapefile', 'schema': {'geometry': 'Point', 'properties': {'RETURN_P': 'int'}}}
dst = fiona.open('new.shp', 'w', **meta)
g = {'coordinates': [1.0, 2.0], 'type': 'Point'}
feature = {'geometry': g, 'properties': {'RETURN_P': None}}
dst.write(feature)
dst.close()

src = fiona.open('new.shp', 'r')
feature = next(src)
assert(feature['properties']['RETURN_P'] is None)  # Fails
src.close()
#  --- run_test.py (end) ---

print('===== fiona-1.8.13.post1-py36hc820daa_0 OK =====');
print("import: 'fiona'")
import fiona

print("import: 'fiona.fio'")
import fiona.fio

