# This file was originally generated by PyScripter's unit test wizard

import unittest
import ogrwrapper as ogrw
from osgeo import ogr


class TestGlobalFunctions(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    @unittest.skip("not implemented")
    def test_create_datacat_dir(self):
        pass

    @unittest.skip("not implemented")
    def test_create_new_shpfile(self):
        pass

    @unittest.skip("not implemented")
    def test_copy_attributes(self):
        pass

    @unittest.skip("not implemented")
    def test_copy_features(self):
        pass

    def testget_geom_details(self):
        source_layer, dest_geom = ogrw.get_geom_details("pt")
        self.assertEqual(source_layer, "points")
        self.assertEqual(dest_geom, ogr.wkbPoint)

        source_layer, dest_geom = ogrw.get_geom_details("ln")
        self.assertEqual(source_layer, "lines")
        self.assertEqual(dest_geom, ogr.wkbLineString)

        source_layer, dest_geom = ogrw.get_geom_details("py")
        self.assertEqual(source_layer, "multipolygons")
        self.assertEqual(dest_geom, ogr.wkbMultiPolygon)

        source_layer, dest_geom = ogrw.get_geom_details("rel")
        self.assertEqual(source_layer, "other_relations")
        self.assertEqual(dest_geom, ogr.wkbUnknown)

        # Test an invalid geometry type value.
        self.assertRaises(ValueError, ogrw.get_geom_details, "abcde")

    @unittest.skip("not implemented")
    def testdo_ogr2ogr_process(self):
        pass

    @unittest.skip("not implemented")
    def testbatch_convert(self):
        pass

if __name__ == '__main__':
    unittest.main()
