Disable 'default_flow_style' for yaml.dump
If this option is False, the collections is always serialized in the block style. Change-Id: I8e8d7cc1773b8c20968ff526110387a0590690b1 Closes-Bug: 1585271
This commit is contained in:
parent
0af74e41be
commit
bdf612bf43
|
@ -138,7 +138,9 @@ class TestYaqlExt(BaseUnitTest):
|
|||
)
|
||||
|
||||
def test_to_yaml(self):
|
||||
expected = yaml.safe_dump(self.variables['$%new']['configs'])
|
||||
expected = yaml.safe_dump(
|
||||
self.variables['$%new']['configs'], default_flow_style=False
|
||||
)
|
||||
actual = self.evaluate('$.configs.toYaml()')
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
|
|
|
@ -28,7 +28,9 @@ else:
|
|||
@specs.method
|
||||
@specs.inject('finalizer', yaqltypes.Delegate('#finalize'))
|
||||
def to_yaml(finalizer, receiver):
|
||||
return yaml.dump_all([finalizer(receiver)], Dumper=YamlDumper)
|
||||
return yaml.dump_all(
|
||||
[finalizer(receiver)], Dumper=YamlDumper, default_flow_style=False
|
||||
)
|
||||
|
||||
|
||||
@specs.method
|
||||
|
|
Loading…
Reference in New Issue