@@ -7,15 +7,17 @@ This file is structured with [yaml syntax](http://www.yaml.org/start.html).
7
7
8
8
A basic test appears under the toplevel key ` tests ` and looks like this:
9
9
10
- - name: centroid
11
- algorithm: qgis:polygoncentroids
12
- params:
13
- - type: vector
14
- name: polys.gml
15
- results:
16
- OUTPUT_LAYER:
17
- type: vector
18
- name: expected/polys_centroid.gml
10
+ ``` yaml
11
+ - name : centroid
12
+ algorithm : qgis:polygoncentroids
13
+ params :
14
+ - type : vector
15
+ name : polys.gml
16
+ results :
17
+ OUTPUT_LAYER :
18
+ type : vector
19
+ name : expected/polys_centroid.gml
20
+ ` ` `
19
21
20
22
How To
21
23
------
@@ -39,16 +41,18 @@ ones to params and the last one(s) to results.
39
41
40
42
The above translates to
41
43
42
- - name: densify
43
- algorithm: qgis:densifygeometriesgivenaninterval
44
- params:
45
- - type: vector
46
- name: polys.gml
47
- - 2 # Interval
48
- results:
49
- OUTPUT:
50
- type: vector
51
- name: expected/polys_densify.gml
44
+ ` ` ` yaml
45
+ - name: densify
46
+ algorithm: qgis:densifygeometriesgivenaninterval
47
+ params:
48
+ - type: vector
49
+ name: polys.gml
50
+ - 2 # Interval
51
+ results:
52
+ OUTPUT:
53
+ type: vector
54
+ name: expected/polys_densify.gml
55
+ ` ` `
52
56
53
57
Params and results
54
58
------------------
@@ -57,17 +61,21 @@ Params and results
57
61
58
62
Params and results are specified as lists or dictionaries :
59
63
60
- params:
61
- INTERVAL: 5
62
- INTERPOLATE: True
63
- NAME: A processing test
64
-
64
+ ` ` ` yaml
65
+ params:
66
+ INTERVAL: 5
67
+ INTERPOLATE: True
68
+ NAME: A processing test
69
+ ` ` `
70
+
65
71
or
66
72
67
- params:
68
- - 2
69
- - string
70
- - another param
73
+ ` ` ` yaml
74
+ params:
75
+ - 2
76
+ - string
77
+ - another param
78
+ ` ` `
71
79
72
80
# ## Layer type parameters
73
81
@@ -80,13 +88,15 @@ You will often need to specify layers as parameters. To specify a layer you will
80
88
81
89
This is what it looks like in action :
82
90
83
- params:
84
- PAR: 2
85
- STR: string
86
- LAYER:
87
- type: vector
88
- name: polys.gml
89
- OTHER: another param
91
+ ` ` ` yaml
92
+ params:
93
+ PAR: 2
94
+ STR: string
95
+ LAYER:
96
+ type: vector
97
+ name: polys.gml
98
+ OTHER: another param
99
+ ` ` `
90
100
91
101
# ## Results
92
102
@@ -96,9 +106,11 @@ Results are specified very similar.
96
106
97
107
It couldn't be more trivial
98
108
109
+ ` ` ` yaml
99
110
OUTPUT:
100
111
name: expected/qgis_intersection.gml
101
112
type: vector
113
+ ` ` `
102
114
103
115
# ### Vector with tolerance
104
116
@@ -114,41 +126,49 @@ field name `__all__` which will apply a certain tolerance to all fields.
114
126
There is another property `geometry` which also accepts a `precision` which is
115
127
applied to each vertex.
116
128
117
- OUTPUT:
118
- type: vector
119
- name: expected/abcd.gml
120
- compare:
121
- fields:
122
- __all__:
123
- precision: 5 # compare to a precision of .00001 on all fields
124
- A: skip # skip field A
125
- geometry:
126
- precision: 5 # compare coordinates with a precision of 5 digits
129
+ ` ` ` yaml
130
+ OUTPUT:
131
+ type: vector
132
+ name: expected/abcd.gml
133
+ compare:
134
+ fields:
135
+ __all__:
136
+ precision: 5 # compare to a precision of .00001 on all fields
137
+ A: skip # skip field A
138
+ geometry:
139
+ precision: 5 # compare coordinates with a precision of 5 digits
140
+ ` ` `
127
141
128
142
# ### Raster files
129
143
130
144
Raster files are compared with a hash checksum. This is calculated when you create
131
145
a test from the processing history.
132
146
133
- OUTPUT:
134
- type: rasterhash
135
- hash: f1fedeb6782f9389cf43590d4c85ada9155ab61fef6dc285aaeb54d6
147
+ ` ` ` yaml
148
+ OUTPUT:
149
+ type: rasterhash
150
+ hash: f1fedeb6782f9389cf43590d4c85ada9155ab61fef6dc285aaeb54d6
151
+ ` ` `
136
152
137
153
# ### Files
138
154
139
155
You can compare the content of an ouptut file by an expected result reference file
140
156
141
- OUTPUT_HTML_FILE:
142
- name: expected/basic_statistics_string.html
143
- type: file
157
+ ` ` ` yaml
158
+ OUTPUT_HTML_FILE:
159
+ name: expected/basic_statistics_string.html
160
+ type: file
161
+ ` ` `
144
162
145
163
Or you can use one or more regular expressions that will be [matched](https://docs.python.org/2/library/re.html#re.search) against the file
146
164
content
147
165
148
- OUTPUT:
149
- name: layer_info.html
150
- type: regex
151
- rules:
152
- - 'Extent: \(-1.000000, -3.000000\) - \(11.000000, 5.000000\)'
153
- - 'Geometry: Line String'
154
- - 'Feature Count: 6'
166
+ ` ` ` yaml
167
+ OUTPUT:
168
+ name: layer_info.html
169
+ type: regex
170
+ rules:
171
+ - 'Extent: \( -1.000000, -3.000000\) - \( 11.000000, 5.000000\) '
172
+ - 'Geometry: Line String'
173
+ - 'Feature Count: 6'
174
+ ` ` `
0 commit comments