Support ignoring cloud-init #cloud-config directives

This commit is contained in:
Marco Ferrari
2021-10-26 11:02:23 +00:00
parent f2e2e0c366
commit 3a767f9ed4
2 changed files with 31 additions and 0 deletions

View File

@@ -80,6 +80,23 @@ class CommentsTestCase(RuleTestCase):
problem3=(9, 2), problem4=(10, 4),
problem5=(15, 3))
def test_cloud_init_cloud_config(self):
conf = ('comments:\n'
' require-starting-space: true\n'
' ignore-cloud-init-cloud-config: false\n'
'document-start: disable\n')
self.check('#cloud-config\n',
conf, problem1=(1, 2))
self.check('# cloud-config\n', conf)
def test_ignore_cloud_init_cloud_config(self):
conf = ('comments:\n'
' require-starting-space: true\n'
' ignore-cloud-init-cloud-config: true\n'
'document-start: disable\n')
self.check('#cloud-config\n', conf)
self.check('# cloud-config\n', conf)
def test_shebang(self):
conf = ('comments:\n'
' require-starting-space: true\n'