def test_to_file_schema(self):
        """
        Ensure that the file is written according to the schema
        if it is specified
        
        """
        try:
            from collections import OrderedDict
        except __HOLE__:
            from ordereddict import OrderedDict

        tempfilename = os.path.join(self.tempdir, 'test.shp')
        properties = OrderedDict([
            ('Shape_Leng', 'float:19.11'),
            ('BoroName', 'str:40'),
            ('BoroCode', 'int:10'),
            ('Shape_Area', 'float:19.11'),
        ])
        schema = {'geometry': 'Polygon', 'properties': properties}

        # Take the first 2 features to speed things up a bit
        self.df.iloc[:2].to_file(tempfilename, schema=schema)

        with fiona.open(tempfilename) as f:
            result_schema = f.schema

        self.assertEqual(result_schema, schema)
dataset/ETHPy150Open geopandas/geopandas/geopandas/tests/test_geodataframe.py/TestDataFrame.test_to_file_schema