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
45db7f7d
Kaydet (Commit)
45db7f7d
authored
Kas 19, 2014
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced caching of a property with @cached_property.
üst
9d3d1a03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
test_data.py
django/contrib/gis/geometry/test_data.py
+6
-11
No files found.
django/contrib/gis/geometry/test_data.py
Dosyayı görüntüle @
45db7f7d
...
...
@@ -8,11 +8,9 @@ import os
from
django.contrib
import
gis
from
django.utils
import
six
from
django.utils._os
import
upath
from
django.utils.functional
import
cached_property
# This global used to store reference geometry data.
GEOMETRIES
=
None
# Path where reference test data is located.
TEST_DATA
=
os
.
path
.
join
(
os
.
path
.
dirname
(
upath
(
gis
.
__file__
)),
'tests'
,
'data'
)
...
...
@@ -95,12 +93,9 @@ class TestDataMixin(object):
Mixin used for GEOS/GDAL test cases that defines a `geometries`
property, which returns and/or loads the reference geometry data.
"""
@property
@
cached_
property
def
geometries
(
self
):
global
GEOMETRIES
if
GEOMETRIES
is
None
:
# Load up the test geometry data from fixture into global.
with
open
(
os
.
path
.
join
(
TEST_DATA
,
'geometries.json'
))
as
f
:
geometries
=
json
.
load
(
f
)
GEOMETRIES
=
TestGeomSet
(
**
strconvert
(
geometries
))
return
GEOMETRIES
# Load up the test geometry data from fixture into global.
with
open
(
os
.
path
.
join
(
TEST_DATA
,
'geometries.json'
))
as
f
:
geometries
=
json
.
load
(
f
)
return
TestGeomSet
(
**
strconvert
(
geometries
))
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