Changeset 1246
- Timestamp:
- 04/03/08 23:08:00 (8 months ago)
- Files:
-
- PleiadesEntity/trunk/tests/LoadEntity.txt (modified) (7 diffs)
- PleiadesEntity/trunk/tests/test_docfiles.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
PleiadesEntity/trunk/tests/LoadEntity.txt
r1225 r1246 40 40 --------------- 41 41 42 >>> TEST_DATA = self.test_params.TEST_DATA 43 >>> BA_ID_MAX = self.test_params.BA_ID_MAX 44 >>> from Products.PleiadesEntity.Extensions.loader import load_place 42 45 >>> r = load_place(folder, "%s/batlas-65-2-24-frank.xml" % TEST_DATA) 43 46 >>> pid = r['place_id'] … … 112 115 >>> len(tps) 113 116 2 114 >>> tps[0].Title 117 >>> tps0 = tps[0].getObject() 118 >>> tps0.Title() 115 119 'Attested: Roman (30 BC - AD 300)' 116 >>> tps [0].getId120 >>> tps0.getId() 117 121 'roman' 118 >>> tps[0].getAttestationConfidence 119 'confident' 120 >>> tps[1].Title 122 >>> tps0.getAttestationConfidence() 123 'confident' 124 >>> tps1 = tps[1].getObject() 125 >>> tps1.Title() 121 126 'Attested: Late Antique (AD 300 - 625)' 122 >>> tps [1].getId127 >>> tps1.getId() 123 128 'late-antique' 124 >>> tps [1].getAttestationConfidence129 >>> tps1.getAttestationConfidence() 125 130 'confident' 126 131 … … 152 157 >>> len(tps) 153 158 1 154 >>> tps[0].Title 159 >>> tps0 = tps[0].getObject() 160 >>> tps0.Title() 155 161 'Attested: Classical (550 - 330 BC)' 156 >>> tps [0].getId162 >>> tps0.getId() 157 163 'classical' 158 >>> tps [0].getAttestationConfidence164 >>> tps0.getAttestationConfidence() 159 165 'confident' 160 166 >>> srs = n1.getFolderContents({'meta_type':['SecondaryReference']}) … … 192 198 >>> len(tps) 193 199 3 194 >>> tps[0].Title 200 >>> tps0 = tps[0].getObject() 201 >>> tps0.Title() 195 202 'Attested: Classical (550 - 330 BC)' 196 >>> tps [0].getId203 >>> tps0.getId() 197 204 'classical' 198 >>> tps[0].getAttestationConfidence 199 'confident' 200 >>> tps[1].Title 205 >>> tps0.getAttestationConfidence() 206 'confident' 207 >>> tps1 = tps[1].getObject() 208 >>> tps1.Title() 201 209 'Attested: Roman (30 BC - AD 300)' 202 >>> tps [1].getId210 >>> tps1.getId() 203 211 'roman' 204 >>> tps[1].getAttestationConfidence 205 'confident' 206 >>> tps[2].Title 212 >>> tps1.getAttestationConfidence() 213 'confident' 214 >>> tps2 = tps[2].getObject() 215 >>> tps2.Title() 207 216 'Attested: Late Antique (AD 300 - 625)' 208 >>> tps [2].getId217 >>> tps2.getId() 209 218 'late-antique' 210 >>> tps [2].getAttestationConfidence219 >>> tps2.getAttestationConfidence() 211 220 'confident' 212 221 >>> l.getTimePeriods() … … 251 260 'RE Ninoe' 252 261 253 Test the geo adapters254 ---------------------255 256 >>> from Products.PleiadesGeocoder.interfaces import IGeoItemSimple, IGeoCollectionSimple257 258 >>> g = IGeoItemSimple(p)259 >>> g.isGeoreferenced()260 True261 >>> g.geom_type262 'Point'263 >>> g.coords264 (28.728899999999999, 37.714500000000001, 0.0)265 >>> gi = g.__geo_interface__266 >>> gi['type']267 'Feature'268 >>> gi['properties']['title']269 'Aphrodisias/Ninoe'270 >>> gi['properties']['description']271 'An ancient settlement, attested during the Classical, Roman and Late Antique periods (modern location: Geyre). It was known in antiquity by the names: Aphrodisias and Ninoe.'272 273 >>> c = IGeoCollectionSimple(folder.places)274 >>> len(list(c.geoItems()))275 1276 277 262 Load one nameless entity 278 263 ------------------------ … … 300 285 'certain' 301 286 302 >>> g = IGeoItemSimple(p)303 >>> g.isGeoreferenced()304 True305 287 306 288 Reload that entity … … 340 322 'certain' 341 323 342 >>> g = IGeoItemSimple(p)343 >>> g.isGeoreferenced()344 False345 PleiadesEntity/trunk/tests/test_docfiles.py
r1244 r1246 3 3 import glob 4 4 import unittest 5 from zope.testing import doctest 6 from zope.component import testing 7 from Testing import ZopeTestCase as ztc 5 import doctest 8 6 from Testing import ZopeTestCase as ztc 9 7 from Products.PloneTestCase import PloneTestCase as ptc 10 8 from Products.PloneTestCase.layer import onsetup, PloneSite 9 import _testing 11 10 12 import _testing13 from _testing import *14 15 ptc.setupPloneSite(products=['Archetypes', 'ATVocabularyManager', 'Geographer', 'PleiadesEntity'])16 11 ptc.installProduct('Geographer') 17 12 ptc.installProduct('ATVocabularyManager') 18 13 ptc.installProduct('PleiadesEntity') 19 #ptc.setupPloneSite(products=['Archetypes', 'ATVocabularyManager', 'Geographer', 'PleiadesEntity'])14 ptc.setupPloneSite(products=['Archetypes', 'ATVocabularyManager', 'Geographer', 'PleiadesEntity']) 20 15 21 16 #REQUIRE_TESTBROWSER = ['PublishGeoEntity.txt'] 22 17 23 optionflags = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE 18 optionflags = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE | doctest.REPORT_ONLY_FIRST_FAILURE 24 19 25 20 class PleiadesEntityTestCase(ptc.PloneTestCase): 26 pass 27 21 22 def afterSetUp(self): 23 self.test_params = _testing 24 28 25 29 26 def test_suite(): … … 31 28 ztc.ZopeDocFileSuite( 32 29 'Entities.txt', 30 package='Products.PleiadesEntity.tests', 31 test_class=PleiadesEntityTestCase, 32 optionflags=optionflags, 33 ), 34 ztc.ZopeDocFileSuite( 35 'LoadEntity.txt', 33 36 package='Products.PleiadesEntity.tests', 34 37 test_class=PleiadesEntityTestCase,
