Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
5ef599c7
Kaydet (Commit)
5ef599c7
authored
Haz 04, 2012
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Used skipUnless decorator to skip tests in geos tests.
üst
f6996411
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
test_geos.py
django/contrib/gis/geos/tests/test_geos.py
+7
-7
No files found.
django/contrib/gis/geos/tests/test_geos.py
Dosyayı görüntüle @
5ef599c7
import
ctypes
import
random
import
unittest
from
django.contrib.gis.geos
import
(
GEOSException
,
GEOSIndexError
,
GEOSGeometry
,
GeometryCollection
,
Point
,
MultiPoint
,
Polygon
,
MultiPolygon
,
LinearRing
,
...
...
@@ -9,6 +8,8 @@ from django.contrib.gis.geos.base import gdal, numpy, GEOSBase
from
django.contrib.gis.geos.libgeos
import
GEOS_PREPARE
from
django.contrib.gis.geometry.test_data
import
TestDataMixin
from
django.utils
import
unittest
class
GEOSTest
(
unittest
.
TestCase
,
TestDataMixin
):
...
...
@@ -195,9 +196,9 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
self
.
assertEqual
(
srid
,
poly
.
shell
.
srid
)
self
.
assertEqual
(
srid
,
fromstr
(
poly
.
ewkt
)
.
srid
)
# Checking export
@unittest.skipUnless
(
gdal
.
HAS_GDAL
and
gdal
.
GEOJSON
,
"gdal >= 1.5 is required"
)
def
test_json
(
self
):
"Testing GeoJSON input/output (via GDAL)."
if
not
gdal
or
not
gdal
.
GEOJSON
:
return
for
g
in
self
.
geometries
.
json_geoms
:
geom
=
GEOSGeometry
(
g
.
wkt
)
if
not
hasattr
(
g
,
'not_equal'
):
...
...
@@ -813,9 +814,9 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
# And, they should be equal.
self
.
assertEqual
(
gc1
,
gc2
)
@unittest.skipUnless
(
gdal
.
HAS_GDAL
,
"gdal is required"
)
def
test_gdal
(
self
):
"Testing `ogr` and `srs` properties."
if
not
gdal
.
HAS_GDAL
:
return
g1
=
fromstr
(
'POINT(5 23)'
)
self
.
assertEqual
(
True
,
isinstance
(
g1
.
ogr
,
gdal
.
OGRGeometry
))
self
.
assertEqual
(
g1
.
srs
,
None
)
...
...
@@ -835,9 +836,9 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
self
.
assertNotEqual
(
poly
.
_ptr
,
cpy1
.
_ptr
)
self
.
assertNotEqual
(
poly
.
_ptr
,
cpy2
.
_ptr
)
@unittest.skipUnless
(
gdal
.
HAS_GDAL
,
"gdal is required"
)
def
test_transform
(
self
):
"Testing `transform` method."
if
not
gdal
.
HAS_GDAL
:
return
orig
=
GEOSGeometry
(
'POINT (-104.609 38.255)'
,
4326
)
trans
=
GEOSGeometry
(
'POINT (992385.4472045 481455.4944650)'
,
2774
)
...
...
@@ -963,9 +964,9 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
self
.
assertEqual
(
geom
,
tmpg
)
if
not
no_srid
:
self
.
assertEqual
(
geom
.
srid
,
tmpg
.
srid
)
@unittest.skipUnless
(
GEOS_PREPARE
,
"geos >= 3.1.0 is required"
)
def
test_prepared
(
self
):
"Testing PreparedGeometry support."
if
not
GEOS_PREPARE
:
return
# Creating a simple multipolygon and getting a prepared version.
mpoly
=
GEOSGeometry
(
'MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))'
)
prep
=
mpoly
.
prepared
...
...
@@ -990,10 +991,9 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
for
geom
,
merged
in
zip
(
ref_geoms
,
ref_merged
):
self
.
assertEqual
(
merged
,
geom
.
merged
)
@unittest.skipUnless
(
GEOS_PREPARE
,
"geos >= 3.1.0 is required"
)
def
test_valid_reason
(
self
):
"Testing IsValidReason support"
# Skipping tests if GEOS < v3.1.
if
not
GEOS_PREPARE
:
return
g
=
GEOSGeometry
(
"POINT(0 0)"
)
self
.
assertTrue
(
g
.
valid
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment