Esempio 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)
Esempio 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)