if not exist tests\data mkdir tests\data || exit 1
xcopy test_data\coutwildrnp.zip tests\data || exit 1
xcopy test_data\coutwildrnp.tar tests\data || exit 1
xcopy test_data\coutwildrnp.json tests\data || exit 1

py.test -s -rxs -v -k "not test_fio_ls_multi_layer" tests


:: the test_fio_ls_multi_layer seems to be a bad test and not a real failure.
:: def test_fio_ls_multi_layer():
::
::     infile = 'tests\data/coutwildrnp.shp'
::     outdir = tempfile.mkdtemp()
::     try:
::
::         :: Copy test shapefile into new directory
::         :: Shapefile driver treats a directory of shapefiles as a single
::         :: multi-layer datasource
::         layer_names = ['l1', 'l2']
::         for layer in layer_names:
::             with fiona.open(infile) as src, \
::                     fiona.open(outdir, 'w', layer=layer, **src.meta) as dst:
::                 for feat in src:
::                     dst.write(feat)
::
::         :: Run CLI test
::         result = CliRunner().invoke(main_group, [
::             'ls', outdir])
::         assert result.exit_code == 0
:: >           assert json.loads(result.output) == layer_names
:: E           AssertionError: assert ['l2', 'l1'] == ['l1', 'l2']
:: E             At index 0 diff: u'l2' != 'l1'
:: E             Full diff:
:: E             - [u'l2', u'l1']
:: E             + ['l1', 'l2']




fio --help
IF %ERRORLEVEL% NEQ 0 exit /B 1
fio ls test_data/test.shp
IF %ERRORLEVEL% NEQ 0 exit /B 1
fio info test_data/test.shp
IF %ERRORLEVEL% NEQ 0 exit /B 1
exit /B 0
