Пример #1
0
 def test_render(self):
     """
     Test basic YAML rendering.
     """
     obj = {'foo':['bar','baz']}
     renderer = YAMLRenderer(None)
     content = renderer.render(obj, 'application/yaml')
     self.assertEquals(content, _yaml_repr)
Пример #2
0
 def test_render(self):
     """
     Test basic YAML rendering.
     """
     obj = {'foo': ['bar', 'baz']}
     renderer = YAMLRenderer(None)
     content = renderer.render(obj, 'application/yaml')
     self.assertEquals(content, _yaml_repr)
Пример #3
0
 def test_render(self):
     """
     Test basic YAML rendering.
     """
     obj = {"foo": ["bar", "baz"]}
     renderer = YAMLRenderer(None)
     content = renderer.render(obj, "application/yaml")
     self.assertEquals(content, _yaml_repr)
Пример #4
0
     def test_render_and_parse(self):
         """
         Test rendering and then parsing returns the original object.
         IE obj -> render -> parse -> obj.
         """
         obj = {'foo':['bar','baz']}
 
         renderer = YAMLRenderer(None)
         parser = YAMLParser(None)
 
         content = renderer.render(obj, 'application/yaml')
         (data, files) = parser.parse(StringIO(content))
         self.assertEquals(obj, data)    
Пример #5
0
        def test_render_and_parse(self):
            """
            Test rendering and then parsing returns the original object.
            IE obj -> render -> parse -> obj.
            """
            obj = {'foo': ['bar', 'baz']}

            renderer = YAMLRenderer(None)
            parser = YAMLParser(None)

            content = renderer.render(obj, 'application/yaml')
            (data, files) = parser.parse(StringIO(content))
            self.assertEquals(obj, data)