| 33 | | 1 |
|---|
| 34 | | |
|---|
| 35 | | Get entity reference for further testing |
|---|
| 36 | | >>> en = entities[0] |
|---|
| 37 | | |
|---|
| 38 | | Verify the id is properly set |
|---|
| 39 | | >>> en.getId() |
|---|
| 40 | | 'batlas-65-2-24' |
|---|
| 41 | | |
|---|
| 42 | | Verify the title is properly set |
|---|
| 43 | | >>> en.Title() |
|---|
| 44 | | 'Aphrodisias/Ninoe' |
|---|
| 45 | | |
|---|
| 46 | | Verify the description is properly set |
|---|
| 47 | | >>> en.Description() |
|---|
| 48 | | 'An ancient settlement, attested from the Classical through the Late Antique periods (modern location: Geyre). It was known in antiquity by the name(s): Aphrodisias and Ninoe.' |
|---|
| 49 | | |
|---|
| 50 | | Verify the identifier field is properly set |
|---|
| 51 | | >>> en.getIdentifier() |
|---|
| 52 | | 'batlas-65-2-24' |
|---|
| 53 | | |
|---|
| 54 | | Verify the entity type is properly set |
|---|
| 55 | | >>> en.getGeoEntityType() |
|---|
| 56 | | 'settlement' |
|---|
| 57 | | |
|---|
| 58 | | Verify the modern location is properly set |
|---|
| 59 | | >>> en.getModernLocation() |
|---|
| 60 | | 'Geyre' |
|---|
| 61 | | |
|---|
| 62 | | Verify the time period(s) are properly set |
|---|
| 63 | | >>> en.getTimePeriods() |
|---|
| 64 | | ('Classical', 'Roman', 'Late Antique') |
|---|
| 65 | | |
|---|
| 66 | | Verify the secondary reference(s) are properly set |
|---|
| 67 | | >>> en.getSecondaryReferences() |
|---|
| 68 | | ('BAtlas 65 A2 Aphrodisias/Ninoe', 'RE 2', 'NPauly 1', 'RE') |
|---|
| 69 | | |
|---|
| 70 | | Verify the spatial coordinates are properly set |
|---|
| 71 | | >>> en.getSpatialCoordinates() |
|---|
| 72 | | '37.7144599999992 28.7288599999993 0.0' |
|---|
| 73 | | |
|---|
| 74 | | Verify the spatial geometry type is properly set |
|---|
| 75 | | >>> en.getSpatialGeometryType() |
|---|
| 76 | | 'point' |
|---|
| 77 | | |
|---|
| 78 | | Check count of names |
|---|
| 79 | | >>> names = en.listFolderContents() |
|---|
| 80 | | >>> len(names) |
|---|
| 81 | | 2 |
|---|
| 82 | | |
|---|
| 83 | | Get reference to the first name for further testing |
|---|
| 84 | | >>> nm0 = names[0] |
|---|
| 85 | | |
|---|
| 86 | | Verify the id is properly set |
|---|
| 87 | | >>> nm0.getId() |
|---|
| 88 | | 'batlas-65-2-24-n1' |
|---|
| 89 | | |
|---|
| 90 | | Verify the title is properly set |
|---|
| 91 | | >>> nm0.Title() |
|---|
| 92 | | 'Aphrodisias' |
|---|
| 93 | | |
|---|
| 94 | | Verify the description is properly set |
|---|
| 95 | | >>> nm0.Description() |
|---|
| 96 | | 'No description' |
|---|
| 97 | | |
|---|
| 98 | | Verify the identifier is properly set |
|---|
| 99 | | >>> nm0.getIdentifier() |
|---|
| 100 | | 'batlas-65-2-24-n1' |
|---|
| 101 | | |
|---|
| 102 | | Verify the attested name is properly set |
|---|
| 103 | | >>> nm0.getNameAttested() |
|---|
| 104 | | '' |
|---|
| 105 | | |
|---|
| 106 | | Verify the name language is properly set |
|---|
| 107 | | >>> nm0.getNameLanguage() |
|---|
| 108 | | '' |
|---|
| 109 | | |
|---|
| 110 | | Verify the time period(s) for this name are properly set |
|---|
| 111 | | >>> nm0.getTimePeriods() |
|---|
| 112 | | ('Roman', 'Late Antique') |
|---|
| 113 | | |
|---|
| 114 | | Verify the primary references for this name are properly set |
|---|
| 115 | | >>> nm0.getPrimaryReferences() |
|---|
| 116 | | () |
|---|
| 117 | | |
|---|
| 118 | | Verify the secondary references for this name properly set |
|---|
| 119 | | >>> nm0.getSecondaryReferences() |
|---|
| 120 | | ('RE 2', 'NPauly 1') |
|---|
| 121 | | |
|---|
| 122 | | Do the same things for the second name |
|---|
| 123 | | >>> nm1 = names[1] |
|---|
| 124 | | |
|---|
| 125 | | >>> nm1.getId() |
|---|
| 126 | | 'batlas-65-2-24-n2' |
|---|
| 127 | | |
|---|
| 128 | | >>> nm1.Title() |
|---|
| 129 | | 'Ninoe' |
|---|
| 130 | | |
|---|
| 131 | | >>> nm1.Description() |
|---|
| 132 | | 'No description' |
|---|
| 133 | | |
|---|
| 134 | | >>> nm1.getIdentifier() |
|---|
| 135 | | 'batlas-65-2-24-n2' |
|---|
| 136 | | |
|---|
| 137 | | >>> nm1.getNameAttested() |
|---|
| 138 | | '' |
|---|
| 139 | | |
|---|
| 140 | | >>> nm1.getNameLanguage() |
|---|
| 141 | | '' |
|---|
| 142 | | |
|---|
| 143 | | >>> nm1.getTimePeriods() |
|---|
| 144 | | ('Classical',) |
|---|
| 145 | | |
|---|
| 146 | | >>> nm1.getPrimaryReferences() |
|---|
| 147 | | () |
|---|
| 148 | | |
|---|
| 149 | | >>> nm1.getSecondaryReferences() |
|---|
| 150 | | ('RE',) |
|---|
| 151 | | |
|---|
| 152 | | Delete the entity and check for result |
|---|
| 153 | | >>> folder.manage_delObjects(['batlas-65-2-24']) |
|---|
| 154 | | >>> entities = folder.listFolderContents() |
|---|
| 155 | | >>> len(entities) |
|---|
| 156 | | 0 |
|---|
| 157 | | |
|---|
| 158 | | Load a whole batch of entities |
|---|
| 159 | | >>> from Products.GeographicEntityLite.Extensions.batching import loaden |
|---|
| 160 | | >>> loaden(folder, source_dir) |
|---|
| 161 | | 'Loaded 7 of 8 files. Failures:\nbatlas-99-9-99.xml\n' |
|---|
| 162 | | |
|---|
| 163 | | Check count of created entities |
|---|
| 164 | | >>> entities = folder.listFolderContents() |
|---|
| 165 | | >>> len(entities) |
|---|
| 166 | | 7 |
|---|
| | 38 | 14 |
|---|