def test_yaml_render_old_unicode(self): config = {"use_yamlloader_old": True} with patch.dict(yaml.__opts__, config): # pylint: disable=no-member self.assert_matches( yaml.render( textwrap.dedent( """\ foo: a: Д b: {'a': u'\\u0414'}""" ) ), {"foo": {"a": "\u0414", "b": {"a": "\u0414"}}}, )
def test_yaml_render_old_unicode(self): config = {'use_yamlloader_old': True} with patch.dict(yaml.__opts__, config): # pylint: disable=no-member self.assert_matches( yaml.render( textwrap.dedent('''\ foo: a: Д b: {'a': u'\\u0414'}''')), {'foo': { 'a': u'\u0414', 'b': { 'a': u'\u0414' } }})
def test_yaml_render_unicode(self): data = "!!python/unicode python unicode string" result = yaml.render(data) self.assertEqual(result, u"python unicode string")
def test_yaml_render_string(self): data = "string" result = yaml.render(data) self.assertEqual(result, data)
def test_yaml_render_unicode(): data = "!!python/unicode python unicode string" result = yaml.render(data) assert result == "python unicode string"
def test_yaml_render_string(): data = "string" result = yaml.render(data) assert result == data