~ubuntuone-pqm-team/django/stable

« back to all changes in this revision

Viewing changes to django/contrib/gis/gdal/tests/test_geom.py

  • Committer: Matias Bordese
  • Date: 2014-08-21 21:22:40 UTC
  • Revision ID: matias.bordese@canonical.com-20140821212240-tij4ms6qzjbdiioz
Tags: 1.5.9
Imported Django 1.5.9 from released tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
except ImportError:
6
6
    import pickle
7
7
 
8
 
from django.contrib.gis.gdal import HAS_GDAL
 
8
from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType, OGRException,
 
9
    OGRIndexError, SpatialReference, CoordTransform, GDAL_VERSION)
9
10
from django.contrib.gis.geometry.test_data import TestDataMixin
10
11
from django.utils.six.moves import xrange
11
12
from django.utils import unittest
12
 
from django.utils.unittest import skipUnless
13
 
 
14
 
if HAS_GDAL:
15
 
    from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType,
16
 
        OGRException, OGRIndexError, SpatialReference, CoordTransform,
17
 
        GDAL_VERSION)
18
 
 
19
 
 
20
 
@skipUnless(HAS_GDAL, "GDAL is required")
 
13
 
21
14
class OGRGeomTest(unittest.TestCase, TestDataMixin):
22
15
    "This tests the OGR Geometry."
23
16
 
483
476
        "Testing equivalence methods with non-OGRGeometry instances."
484
477
        self.assertNotEqual(None, OGRGeometry('POINT(0 0)'))
485
478
        self.assertEqual(False, OGRGeometry('LINESTRING(0 0, 1 1)') == 3)
 
479
 
 
480
def suite():
 
481
    s = unittest.TestSuite()
 
482
    s.addTest(unittest.makeSuite(OGRGeomTest))
 
483
    return s
 
484
 
 
485
def run(verbosity=2):
 
486
    unittest.TextTestRunner(verbosity=verbosity).run(suite())