Ejemplo n.º 1
0
    def testMultipleDicts(self):
        dumped = yaml.DumpMany([
            collections.OrderedDict([("foo", 42), ("bar", 108)]),
            collections.OrderedDict([("quux", "norf"), ("thud", "blargh")]),
        ])

        expected = """\
foo: 42
bar: 108
---
quux: norf
thud: blargh
"""

        self.assertEqual(dumped, expected)
Ejemplo n.º 2
0
    def testUnicode(self):
        dumped = yaml.DumpMany([
            {
                "gąszcz": "żuk"
            },
            {
                "gęstwina": "chrabąszcz"
            },
        ])

        expected = """\
gąszcz: żuk
---
gęstwina: chrabąszcz
"""

        self.assertEqual(dumped, expected)