root/Rtree/trunk/tests/properties.txt

Revision 1329, 4.2 KB (checked in by hobu, 7 months ago)

nuke the test so it doesn't return a long to silence error on newer 64bit pythons

Line 
1Testing rtree properties
2==========================
3
4Make a simple properties object
5    >>> from rtree import index
6    >>> p = index.Property()
7    >>> p
8    <rtree.index.Property object at 0x...>
9   
10    >>> p.type = 0
11    >>> p.type
12    0
13   
14    >>> p.type = 2
15    >>> p.type
16    2
17
18    >>> p.type = 6
19    Traceback (most recent call last):
20    ...
21    RTreeError: LASError in "IndexProperty_SetIndexType": Inputted value is not a valid index type
22
23    >>> p.dimension = 3
24    >>> p.dimension
25    3
26   
27    >>> p.dimension = 2
28    >>> p.dimension
29    2
30   
31    >>> p.dimension = -2
32    Traceback (most recent call last):
33    ...
34    RTreeError: Negative or 0 dimensional indexes are not allowed
35   
36    >>> p.variant = 0
37    >>> p.variant
38    0
39   
40    >>> p.variant = 6
41    Traceback (most recent call last):
42    ...
43    RTreeError: LASError in "IndexProperty_SetIndexVariant": Inputted value is not a valid index variant
44   
45    >>> p.storage = 0
46    >>> p.storage
47    0
48   
49    >>> p.storage = 1
50    >>> p.storage
51    1
52   
53    >>> p.storage = 3
54    Traceback (most recent call last):
55    ...
56    RTreeError: LASError in "IndexProperty_SetIndexStorage": Inputted value is not a valid index storage type
57   
58    >>> p.index_capacity
59    100
60   
61    >>> p.index_capacity = 300
62    >>> p.index_capacity
63    300
64   
65    >>> p.index_capacity = -4321
66    Traceback (most recent call last):
67    ...
68    RTreeError: index_capacity must be > 0
69   
70    >>> p.pagesize
71    4096
72   
73    >>> p.pagesize = 8192
74    >>> p.pagesize
75    8192
76   
77    >>> p.pagesize = -4321
78    Traceback (most recent call last):
79    ...
80    RTreeError: Pagesize must be > 0
81
82    >>> p.leaf_capacity
83    100
84   
85    >>> p.leaf_capacity = 1000
86    >>> p.leaf_capacity
87    1000
88    >>> p.leaf_capacity = -4321
89    Traceback (most recent call last):
90    ...
91    RTreeError: leaf_capacity must be > 0
92   
93    >>> p.index_pool_capacity
94    100
95   
96    >>> p.index_pool_capacity = 1500
97    >>> p.index_pool_capacity = -4321
98    Traceback (most recent call last):
99    ...
100    RTreeError: index_pool_capacity must be > 0
101
102    >>> p.point_pool_capacity
103    500
104   
105    >>> p.point_pool_capacity = 1500
106    >>> p.point_pool_capacity = -4321
107    Traceback (most recent call last):
108    ...
109    RTreeError: point_pool_capacity must be > 0
110
111    >>> p.region_pool_capacity
112    1000
113   
114    >>> p.region_pool_capacity = 1500
115    >>> p.region_pool_capacity
116    1500
117    >>> p.region_pool_capacity = -4321
118    Traceback (most recent call last):
119    ...
120    RTreeError: region_pool_capacity must be > 0
121
122    >>> p.buffering_capacity
123    10
124   
125    >>> p.buffering_capacity = 100
126    >>> p.buffering_capacity = -4321
127    Traceback (most recent call last):
128    ...
129    RTreeError: buffering_capacity must be > 0   
130
131    >>> p.tight_mbr
132    True
133   
134    >>> p.tight_mbr = 100
135    >>> p.tight_mbr
136    True
137   
138    >>> p.tight_mbr = False
139    >>> p.tight_mbr
140    False
141
142    >>> p.overwrite
143    True
144   
145    >>> p.overwrite = 100
146    >>> p.overwrite
147    True
148   
149    >>> p.overwrite = False
150    >>> p.overwrite
151    False
152
153    >>> p.near_minimum_overlap_factor
154    32
155   
156    >>> p.near_minimum_overlap_factor = 100
157    >>> p.near_minimum_overlap_factor = -4321
158    Traceback (most recent call last):
159    ...
160    RTreeError: near_minimum_overlap_factor must be > 0 
161
162    >>> p.writethrough
163    False
164   
165    >>> p.writethrough = 100
166    >>> p.writethrough
167    True
168   
169    >>> p.writethrough = False
170    >>> p.writethrough
171    False   
172
173    >>> p.fill_factor
174    0.69999999999999996
175   
176    >>> p.fill_factor = 0.99
177    >>> p.fill_factor
178    0.98999999999999999
179   
180    >>> p.split_distribution_factor
181    0.40000000000000002
182   
183    >>> p.tpr_horizon
184    20.0
185   
186    >>> p.reinsert_factor
187    0.29999999999999999
188   
189    >>> p.filename
190    ''
191   
192    >>> p.filename = 'testing123testing'
193    >>> p.filename
194    'testing123testing'
195   
196    >>> p.dat_extension
197    'dat'
198
199    >>> p.dat_extension = 'data'
200    >>> p.dat_extension
201    'data'
202   
203    >>> p.idx_extension
204    'idx'
205    >>> p.idx_extension = 'index'
206    >>> p.idx_extension
207    'index'
208   
209    >>> p.index_id
210    Traceback (most recent call last):
211    ...
212    RTreeError: Error in "IndexProperty_GetIndexID": Property IndexIdentifier was empty
213    >>> p.index_id = -420
214    >>> int(p.index_id)
215    -420
Note: See TracBrowser for help on using the browser.