@@ -286,5 +286,92 @@ def test_writer_keywords_default_template():
286
286
287
287
288
288
*Automatic helm documentation generated using [very-doge-wow/stella](https://github.com/very-doge-wow/stella).*
289
-
290
- """
289
+
290
+ """
291
+
292
+
293
+ def test_writer_empty ():
294
+ doc = {
295
+ "type" : "application" ,
296
+ "version" : "1.0" ,
297
+ "appVersion" : "1.1" ,
298
+ "apiVersion" : "1.2" ,
299
+ "name" : "unittest" ,
300
+ "description" : "simple templating test" ,
301
+ "dependencies" : [],
302
+ "templates" : [],
303
+ "objects" : [
304
+ {
305
+ "kind" : "Ingress" ,
306
+ "from Template" : "template.yaml"
307
+ }
308
+ ],
309
+ "values" : [
310
+ {
311
+ "name" : "ReplicaCount" ,
312
+ "description" : "how many replicas to deploy" ,
313
+ "default" : "1" ,
314
+ "example" : "replicaCount: 2"
315
+ }
316
+ ]
317
+ }
318
+
319
+ result = doc_writer .write ("test/output.md" , doc , "" )
320
+ assert result == """
321
+ # unittest
322
+    
323
+
324
+ ## Description
325
+ simple templating test
326
+
327
+ ## Dependencies
328
+ This chart depends on the following subcharts.
329
+
330
+ *No dependencies found.*
331
+
332
+ ## Templates
333
+ The following templates will be deployed.
334
+
335
+ *No templates found.*
336
+
337
+ ### Objects
338
+ The aforementioned templates will deploy the following objects.
339
+
340
+ | Kind | From template |
341
+ |---|---|
342
+ | Ingress | template.yaml |
343
+
344
+
345
+ ## Values
346
+ The following values can/will be used for deployments.
347
+
348
+ | Name | Description | Default | Example |
349
+ |---|---|---|---|
350
+ | ReplicaCount | how many replicas to deploy | <pre>1</pre> | <pre>replicaCount: 2</pre> |
351
+
352
+
353
+ *Automatic helm documentation generated using [very-doge-wow/stella](https://github.com/very-doge-wow/stella).*
354
+
355
+ """
356
+
357
+
358
+ def test_get_name_from_keyword ():
359
+ keywords = [
360
+ "{{ stella.lol }}" ,
361
+ "{{ stella.banana }}" ,
362
+ "" ,
363
+ "{{stella.rofl}}" ,
364
+ "{{pear}}"
365
+ ]
366
+
367
+ results = [
368
+ "lol" ,
369
+ "banana" ,
370
+ "" ,
371
+ "rofl" ,
372
+ "pear"
373
+ ]
374
+
375
+ for index , keyword in enumerate (keywords ):
376
+ result = doc_writer .get_name_from_keyword (keyword )
377
+ assert results [index ] == result
0 commit comments