8ba65fe01ea1302333713fdc31401712d271dedb
[snaps.git] / docs / how-to-use / UnitTests.rst
1 SNAPS Unit Testing
2 ==================
3
4 | Tests designated as Unit tests extend the unittest.TestCase class and
5   can be exercised without any external resources
6 | other than the filesystem. Most of these tests simply ensure that the
7   configuration settings classes check their
8 | constructor arguments properly.
9
10 The Test Classes
11 ================
12
13 FileUtilsTests
14 --------------
15
16 -  testFileIsDirectory - ensures that the expected path is a directory
17 -  testFileNotExist - ensures that a file that does not exist returns
18    False
19 -  testFileExists - ensures that a file that does exist returns True
20 -  testDownloadBadUrl - ensures that an Exception is thrown when
21    attempting to download a file with a bad URL
22 -  testCirrosImageDownload - ensures that the Cirros image can be
23    downloaded
24 -  testReadOSEnvFile - ensures that an OpenStack RC file can be properly
25    parsed
26
27 ProxySettingsUnitTests
28 ----------------------
29
30 Ensures that all required members are included when constructing a
31 ProxySettings object
32
33 OSCredsUnitTests
34 ----------------
35
36 Ensures that all required members are included when constructing a
37 OSCreds object
38
39 SecurityGroupRuleSettingsUnitTests
40 ----------------------------------
41
42 Ensures that all required members are included when constructing a
43 SecurityGroupRuleSettings object
44
45 SecurityGroupRuleDomainObjectTests
46 ----------------------------------
47
48 Ensures that all required members are included when constructing a
49 SecurityGroupRule domain object
50
51 SecurityGroupSettingsUnitTests
52 ------------------------------
53
54 Ensures that all required members are included when constructing a
55 SecuirtyGroupSettings object
56
57 SecurityGroupDomainObjectTests
58 ------------------------------
59
60 Ensures that all required members are included when constructing a
61 SecurityGroup domain object
62
63 ImageConfigUnitTests
64 --------------------
65
66 Ensures that all required members are included when constructing a
67 ImageConfig object
68
69 ImageSettingsUnitTests
70 ----------------------
71
72 Ensures that all required members are included when constructing a
73 ImageSettings object (deprecated see ImageConfigUnitTests)
74
75 ImageDomainObjectTests
76 ----------------------
77
78 Ensures that all required members are included when constructing a
79 Image domain object
80
81 FlavorConfigUnitTests
82 ---------------------
83
84 Ensures that all required members are included when constructing a
85 FlavorConfig object
86
87 FlavorSettingsUnitTests
88 -----------------------
89
90 Ensures that all required members are included when constructing a
91 deprecated FlavorSettings object
92
93 FlavorDomainObjectTests
94 -----------------------
95
96 Ensures that all required members are included when constructing a
97 Flavor domain object
98
99 KeypairConfigUnitTests
100 ----------------------
101
102 Ensures that all required members are included when constructing a
103 KeypairConfig object
104
105 KeypairSettingsUnitTests
106 ------------------------
107
108 Ensures that all required members are included when constructing a
109 deprecated KeypairSettings object
110
111 KeypairDomainObjectTests
112 ------------------------
113
114 Ensures that all required members are included when constructing a
115 Keypair domain object
116
117 UserConfigUnitTests
118 -------------------
119
120 Ensures that all required members are included when constructing a
121 UserConfig object
122
123 UserSettingsUnitTests
124 ---------------------
125
126 Ensures that all required members are included when constructing a
127 deprecated UserSettings object
128
129 UserDomainObjectTests
130 ---------------------
131
132 Ensures that all required members are included when constructing a
133 User domain object
134
135 ProjectConfigUnitTests
136 ----------------------
137
138 Ensures that all required members are included when constructing a
139 ProjectConfig object
140
141 ProjectSettingsUnitTests
142 ------------------------
143
144 Ensures that all required members are included when constructing a
145 deprecated ProjectSettings object
146
147 ProjectDomainObjectTests
148 ------------------------
149
150 Ensures that all required members are included when constructing a
151 Project domain object
152
153 DomainDomainObjectTests
154 -----------------------
155
156 Ensures that all required members are included when constructing a
157 Domain domain object
158
159 ComputeQuotasDomainObjectTests
160 ------------------------------
161
162 Ensures that all required members are included when constructing a
163 ComputeQuotas domain object
164
165 NetworkQuotasDomainObjectTests
166 ------------------------------
167
168 Ensures that all required members are included when constructing a
169 NetworkQuotas domain object
170
171 RoleDomainObjectTests
172 ---------------------
173
174 Ensures that all required members are included when constructing a
175 Role domain object
176
177 NetworkSettingsUnitTests
178 ------------------------
179
180 Ensures that all required members are included when constructing a
181 NetworkSettings object
182
183 NetworkObjectTests
184 ------------------
185
186 Ensures that all required members are included when constructing a
187 Network domain object
188
189 SubnetSettingsUnitTests
190 -----------------------
191
192 Ensures that all required members are included when constructing a
193 SubnetSettings object
194
195 SubnetObjectTests
196 -----------------
197
198 Ensures that all required members are included when constructing a
199 Subnet domain object
200
201 PortSettingsUnitTests
202 ---------------------
203
204 Ensures that all required members are included when constructing a
205 PortSettings object
206
207 PortDomainObjectTests
208 ---------------------
209
210 Ensures that all required members are included when constructing a
211 Port domain object
212
213 RouterConfigUnitTests
214 ---------------------
215
216 Ensures that all required members are included when constructing a
217 RouterConfig object
218
219 RouterSettingsUnitTests
220 -----------------------
221
222 Ensures that all required members are included when constructing a
223 deprecated RouterSettings object
224
225 RouterDomainObjectTests
226 -----------------------
227
228 Ensures that all required members are included when constructing a
229 Router domain object
230
231 InterfaceRouterDomainObjectTests
232 --------------------------------
233
234 Ensures that all required members are included when constructing a
235 InterfaceRouter domain object
236
237 StackSettingsUnitTests
238 ----------------------
239
240 Ensures that all required members are included when constructing a
241 StackSettings object
242
243 StackDomainObjectTests
244 ----------------------
245
246 Ensures that all required members are included when constructing a
247 Stack domain object (for Heat)
248
249 ResourceDomainObjectTests
250 -------------------------
251
252 Ensures that all required members are included when constructing a
253 Resource domain object (for Heat)
254
255 OutputDomainObjectTests
256 -----------------------
257
258 Ensures that all required members are included when constructing a
259 Output domain object (for Heat)
260
261 VolumeSettingsUnitTests
262 -----------------------
263
264 Ensures that all required members are included when constructing a
265 VolumeSettings object
266
267 VolumeDomainObjectTests
268 -----------------------
269
270 Ensures that all required members are included when constructing a
271 Volume domain object (for Cinder)
272
273 VolumeTypeSettingsUnitTests
274 ---------------------------
275
276 Ensures that all required members are included when constructing a
277 VolumeTypeSettings object
278
279 VolumeTypeDomainObjectTests
280 ---------------------------
281
282 Ensures that all required members are included when constructing a
283 VolumeType domain object (for Cinder)
284
285 VolumeTypeEncryptionObjectTests
286 -------------------------------
287
288 Ensures that all required members are included when constructing a
289 VolumeTypeEncryption domain object (for Cinder)
290
291 QoSSettingsUnitTests
292 --------------------
293
294 Ensures that all required members are included when constructing a
295 QoSSettings object
296
297 QoSSpecDomainObjectTests
298 ------------------------
299
300 Ensures that all required members are included when constructing a
301 QoSSpec domain object (for Cinder)
302
303 VolumeDomainObjectTests
304 -----------------------
305
306 Ensures that all required members are included when constructing a
307 Volume domain object (for Cinder)
308
309 FloatingIpSettingsUnitTests
310 ---------------------------
311
312 Ensures that all required members are included when constructing a
313 FloatingIpSettings object
314
315 FloatingIpDomainObjectTests
316 ---------------------------
317
318 Ensures that all required members are included when constructing a
319 FloatingIp domain object
320
321 VmInstanceSettingsUnitTests
322 ---------------------------
323
324 Ensures that all required members are included when constructing a
325 VmInstanceSettings object
326
327 VmInstDomainObjectTests
328 -----------------------
329
330 Ensures that all required members are included when constructing a
331 VmInst domain object
332
333 SettingsUtilsUnitTests
334 ----------------------
335
336 Ensures that the settings_utils.py#create_volume_settings() function properly
337 maps a snaps.domain.Volume object correctly to a
338 snaps.openstack.create_volume.VolumeSettings object as well as a
339 snaps.domain.VolumeType object to a
340 snaps.openstack.create_volume.VolumeSettings object
341
342
343 Ensures that the settings_utils.py#create_flavor_config() function properly
344 maps a snaps.domain.Flavor object correctly to a
345 snaps.config.flavor.FlavorConfig object